From a86fdb6634137d26671e3a13e13bcd89de75f352 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sat, 25 Mar 2006 18:57:36 +0000 Subject: [PATCH] Portability --- command.cc | 18 +++++++++--------- defines.h | 2 ++ voptions.cc | 2 +- voptions.h | 1 + vvideolive.cc | 11 ++++++++++- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/command.cc b/command.cc index 286e1bd..3f55d2a 100644 --- a/command.cc +++ b/command.cc @@ -456,27 +456,27 @@ void Command::doJustConnected(VConnect* vconnect) if (config) { - if (!strcasecmp(config, "On")) + if (!STRCASECMP(config, "On")) { logger->log("Command", Log::INFO, "Config says Power After Boot = On"); } - else if (!strcasecmp(config, "Off")) + else if (!STRCASECMP(config, "Off")) { logger->log("Command", Log::INFO, "Config says Power After Boot = Off"); doStandby(); delete[] config; return; // quit here } - else if (!strcasecmp(config, "Last state")) + else if (!STRCASECMP(config, "Last state")) { char* lastPowerState = vdr->configLoad("General", "Last Power State"); if (lastPowerState) { - if (!strcasecmp(lastPowerState, "On")) + if (!STRCASECMP(lastPowerState, "On")) { logger->log("Command", Log::INFO, "Config says Last Power State = On"); } - else if (!strcasecmp(lastPowerState, "Off")) + else if (!STRCASECMP(lastPowerState, "Off")) { logger->log("Command", Log::INFO, "Config says Last Power State = Off"); doStandby(); @@ -512,7 +512,7 @@ void Command::doJustConnected(VConnect* vconnect) if (config) { - if (!strcasecmp(config, "S-Video")) + if (!STRCASECMP(config, "S-Video")) { logger->log("Command", Log::INFO, "Switching to S-Video as Connection=%s", config); video->setConnection(Video::SVIDEO); @@ -535,7 +535,7 @@ void Command::doJustConnected(VConnect* vconnect) if (config) { - if (!strcasecmp(config, "New")) + if (!STRCASECMP(config, "New")) { logger->log("Command", Log::INFO, "Switching to New remote type"); remote->setRemoteType(Remote::NEWREMOTE); @@ -558,7 +558,7 @@ void Command::doJustConnected(VConnect* vconnect) config = vdr->configLoad("TV", "Aspect"); if (config) { - if (!strcasecmp(config, "16:9")) + if (!STRCASECMP(config, "16:9")) { logger->log("Command", Log::INFO, "/// Switching to TV aspect 16:9"); video->setTVsize(Video::ASPECT16X9); @@ -579,7 +579,7 @@ void Command::doJustConnected(VConnect* vconnect) config = vdr->configLoad("TV", "Widemode"); if (config) { - if (!strcasecmp(config, "Letterbox")) + if (!STRCASECMP(config, "Letterbox")) { logger->log("Command", Log::INFO, "Setting letterbox mode"); video->setMode(Video::LETTERBOX); diff --git a/defines.h b/defines.h index dcc5a89..bb4ebeb 100644 --- a/defines.h +++ b/defines.h @@ -36,9 +36,11 @@ ULLONG ntohll(ULLONG a); #ifdef WIN32 #define SNPRINTF _snprintf #define VSNPRINTF _vsnprintf +#define STRCASECMP stricmp #else #define SNPRINTF snprintf #define VSNPRINTF vsnprintf +#define STRCASECMP strcasecmp #endif #endif diff --git a/voptions.cc b/voptions.cc index 47c9fd7..2157ddf 100644 --- a/voptions.cc +++ b/voptions.cc @@ -81,7 +81,7 @@ VOptions::VOptions(View* tparent, const char* title, const OPTIONDATA* toptionDa { for (j = 0; j < optionData[i].optionCount; j++) { - if (!strcasecmp(config, optionData[i].options[j])) + if (!STRCASECMP(config, optionData[i].options[j])) { optionBoxes[i].setSelected(tr((char*)optionData[i].options[j])); } diff --git a/voptions.h b/voptions.h index d30dbad..c7b959c 100644 --- a/voptions.h +++ b/voptions.h @@ -22,6 +22,7 @@ #define VOPTIONS_H #include +#include "defines.h" #include "view.h" #include "viewman.h" #include "vdr.h" diff --git a/vvideolive.cc b/vvideolive.cc index 95b03a3..f854de4 100644 --- a/vvideolive.cc +++ b/vvideolive.cc @@ -137,7 +137,16 @@ int VVideoLive::handleCommand(int command) return 2; } - case Remote::ZERO ... Remote::NINE: + case Remote::ZERO: + case Remote::ONE: + case Remote::TWO: + case Remote::THREE: + case Remote::FOUR: + case Remote::FIVE: + case Remote::SIX: + case Remote::SEVEN: + case Remote::EIGHT: + case Remote::NINE: { VChannelSelect* v = new VChannelSelect(this, command); v->draw(); -- 2.39.5