GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#include "boxstack.h"
{
case Message::CLOSE_ME:
{
- remove((Boxx*)m->from);
+ remove(static_cast<Boxx*>(m->from));
break;
}
case Message::ADD_VIEW:
{
- Boxx* toAdd = (Boxx*)m->parameter;
+ Boxx* toAdd = reinterpret_cast<Boxx*>(m->parameter);
add(toAdd);
toAdd->draw();
update(toAdd);
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#include "dsock.h"
myAddr.sin_addr.s_addr = getIPNumber(iterate_ip++); // auto-fill with my IP
memset(&(myAddr.sin_zero), 0, 8); // zero the rest of the struct
- if (bind(socketnum, (struct sockaddr *)&myAddr, addrlen) == -1)
+ if (bind(socketnum, reinterpret_cast<struct sockaddr *>(&myAddr), addrlen) == -1)
{ perror("bind"); return 0; }
FD_ZERO(&readfds);
tv.tv_usec = 0;
int allowed = 1;
- setsockopt(socketnum, SOL_SOCKET, SO_BROADCAST, (char*)&allowed, sizeof(allowed));
+ setsockopt(socketnum, SOL_SOCKET, SO_BROADCAST, static_cast<void*>(&allowed), sizeof(allowed));
initted = true;
{ return 1; }
if ((mlength = recvfrom(socketnum, buf, MAXBUFLEN, 0,
- (struct sockaddr *)&theirAddr, &addrlen)) == -1)
+ reinterpret_cast<struct sockaddr *>(&theirAddr), &addrlen)) == -1)
{ perror("recvfrom"); return 0; }
else
{
//printf("%s:%i\tIN %i\t", fromIPA, fromPort, mlength);
int k;
for(k = 0; k < mlength; k++)
- printf("%u ", (unsigned char)buf[k]);
+ printf("%u ", static_cast<unsigned char>(buf[k]));
printf("\n");
}
return 2;
int k;
UCHAR l;
for (k = 0; k < length; k++)
- { l = (UCHAR)message[k]; printf("%u ", l); }
+ { l = static_cast<UCHAR>(message[k]); printf("%u ", l); }
}
int sentLength = 0;
errno = 0;
- sentLength = sendto(socketnum, message, length, 0, (struct sockaddr *)&theirAddr, addrlen);
+ sentLength = sendto(socketnum, message, length, 0, reinterpret_cast<struct sockaddr *>(&theirAddr), addrlen);
if (sentLength == length)
{
if (DSOCKDEBUG) printf(" GOOD\n");
{
printf(" --BAD--"); fflush(stdout);
}
- sentLength = sendto(socketnum, message, length, 0, (struct sockaddr *)&theirAddr, addrlen);
+ sentLength = sendto(socketnum, message, length, 0, reinterpret_cast<struct sockaddr *>(&theirAddr), addrlen);
if (sentLength == length)
{
if (DSOCKDEBUG) printf(" GOOD\n");
}
}
-ULONG DatagramSocket::getIPNumber(ULONG num)
-{
#ifndef WIN32
+ULONG DatagramSocket::getIPNumber(ULONG)
+{
return INADDR_ANY;
-
- // gcc 3.4 says:
- // warning: Using 'gethostbyname' in statically linked applications requires at runtime
- // the shared libraries from the glibc version used for linking
-
+}
#else
-
+ULONG DatagramSocket::getIPNumber(ULONG num)
+{
char buffer[100];
ULONG returnaddress;
int get_ip=(num%num_ip);//Just wrap around, if no interface are present any more
memcpy(&returnaddress, hosts->h_addr_list[get_ip], sizeof(ULONG));
return returnaddress;
-
-#endif
}
+#endif
logger->log("VConnect", Log::DEBUG, "Draw done");
}
-int VConnect::handleCommand(int command)
+int VConnect::handleCommand(int /* command */)
{
return 1;
}
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
/*
vepg presents a 2 dimensional electronic programme guide with channels down
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#include "vmute.h"
Timers::getInstance()->setTimerD(this, 1, 2);
}
-void VMute::timercall(int clientReference)
+void VMute::timercall(int /* clientReference */)
{
// delete me!
Message* m = new Message(); // Delete self
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#include "vrecordinglist.h"
else if (m->message == Message::MOVE_RECORDING)
{
Log::getInstance()->log("VRecordingList", Log::DEBUG, "Doing move recording");
- doMoveRecording((Directory*)m->parameter);
+ doMoveRecording(reinterpret_cast<Directory*>(m->parameter));
}
else if (m->message == Message::PLAY_SELECTED_RECORDING)
{
BoxStack::getInstance()->update(v);
return 2;
}
+
+ [[fallthrough]]; // it won't, as long as sl.getCurrentOptionData() is 1-5, but keep the compiler happy
}
case Remote::BACK:
{
Message* m1 = new Message();
m1->message = Message::ADD_VIEW;
m1->to = BoxStack::getInstance();
- m1->parameter = (ULONG)count;
+ m1->parameter = reinterpret_cast<ULONG>(count);
MessageQueue::getInstance()->postMessage(m1);
}
MILLISLEEP(1000);
Timers::getInstance()->setTimerD(this, 1, 2);
}
-void VSleeptimer::timercall(int clientReference)
+void VSleeptimer::timercall(int /* clientReference */)
{
// delete me!
Message* m = new Message(); // Delete self
}
// else drop through to stop
}
+ [[fallthrough]];
case Remote::STOP:
{
stop();
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#include <math.h>
removeSummary();
return 2;
}
- } // DROP THROUGH
+ }
+ [[fallthrough]];
case Remote::STOP:
case Remote::MENU:
{
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#include "vvolume.h"
Timers::getInstance()->setTimerD(this, 1, 2);
}
-void VVolume::timercall(int clientReference)
+void VVolume::timercall(int /* clientReference */)
{
// delete me!
Message* m = new Message(); // Delete self
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#include "vwelcome.h"
Timers::getInstance()->setTimerT(this, 1, dt);
}
-void VWelcome::timercall(int clientReference)
+void VWelcome::timercall(int /* clientReference */)
{
#ifndef GRADIENT_DRAWING
drawClock();