Remove NULL and replace it with 0.
From: Erik Hovland <erik@hovland.org>
---
mythtv/libs/libmythdb/compat.h | 10 +++++-----
mythtv/libs/libmythdb/httpcomms.cpp | 20 ++++++++++----------
mythtv/libs/libmythdb/httpcomms.h | 12 ++++++------
mythtv/libs/libmythdb/lcddevice.cpp | 14 +++++++-------
mythtv/libs/libmythdb/mythdb.cpp | 4 ++--
mythtv/libs/libmythdb/mythdbcon.cpp | 6 +++---
mythtv/libs/libmythdb/mythobservable.cpp | 2 +-
mythtv/libs/libmythdb/mythsocket.cpp | 12 ++++++------
mythtv/libs/libmythdb/mythsocket.h | 2 +-
mythtv/libs/libmythdb/mythverbose.h | 2 +-
mythtv/libs/libmythdb/oldsettings.cpp | 2 +-
11 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/mythtv/libs/libmythdb/compat.h b/mythtv/libs/libmythdb/compat.h
index 3fb8f30..afd7bde 100644
a
|
b
|
inline int usleep(unsigned int timeout) |
100 | 100 | /* |
101 | 101 | // windows seems to have 1us-resolution timers, |
102 | 102 | // however this produces the same results as Sleep |
103 | | HANDLE hTimer = ::CreateWaitableTimer(NULL, TRUE, NULL); |
| 103 | HANDLE hTimer = ::CreateWaitableTimer(0, TRUE, 0); |
104 | 104 | if (hTimer) { |
105 | 105 | LARGE_INTEGER li; |
106 | 106 | li.QuadPart = -((int)timeout * 10); |
107 | | if (SetWaitableTimer(hTimer, &li, 0, NULL, 0, FALSE)) { |
| 107 | if (SetWaitableTimer(hTimer, &li, 0, 0, 0, FALSE)) { |
108 | 108 | DWORD res = WaitForSingleObject(hTimer, (timeout / 1000 + 1)); |
109 | 109 | if (res == WAIT_TIMEOUT || res == WAIT_OBJECT_0) |
110 | 110 | return 0; |
… |
… |
inline int statfs(const char* path, struct statfs* buffer) |
184 | 184 | #define mkfifo(path, mode) \ |
185 | 185 | (int)CreateNamedPipeA(path, PIPE_ACCESS_DUPLEX | WRITE_DAC, \ |
186 | 186 | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, \ |
187 | | 1024, 1024, 10000, NULL) |
| 187 | 1024, 1024, 10000, 0) |
188 | 188 | #endif // USING_MINGW |
189 | 189 | |
190 | 190 | #ifdef USING_MINGW |
… |
… |
inline const char *dlerror(void) |
202 | 202 | if (!FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | |
203 | 203 | FORMAT_MESSAGE_IGNORE_INSERTS | |
204 | 204 | FORMAT_MESSAGE_MAX_WIDTH_MASK, |
205 | | NULL, errCode, |
| 205 | 0, errCode, |
206 | 206 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), |
207 | | errStr, DLERR_MAX - 1, NULL)) |
| 207 | errStr, DLERR_MAX - 1, 0)) |
208 | 208 | snprintf(errStr, DLERR_MAX - 1, |
209 | 209 | "dlopen()/dlsym() caused error %d", (int)errCode); |
210 | 210 | |
diff --git a/mythtv/libs/libmythdb/httpcomms.cpp b/mythtv/libs/libmythdb/httpcomms.cpp
index 33debf7..c4ce8c8 100644
a
|
b
|
HttpComms::~HttpComms() |
38 | 38 | if (m_timer) |
39 | 39 | { |
40 | 40 | delete m_timer; |
41 | | m_timer = NULL; |
| 41 | m_timer = 0; |
42 | 42 | } |
43 | 43 | |
44 | 44 | delete http; |
… |
… |
HttpComms::~HttpComms() |
46 | 46 | |
47 | 47 | void HttpComms::init() |
48 | 48 | { |
49 | | // m_curRequest = NULL; |
| 49 | // m_curRequest = 0; |
50 | 50 | m_authNeeded = false; |
51 | 51 | http = new QHttp(); |
52 | 52 | m_redirectedURL = ""; |
53 | 53 | m_done = false; |
54 | 54 | m_statusCode = 0; |
55 | 55 | m_responseReason = ""; |
56 | | m_timer = NULL; |
| 56 | m_timer = 0; |
57 | 57 | m_timeout = false; |
58 | 58 | |
59 | 59 | |
… |
… |
void HttpComms::request(QUrl &url, int timeoutms, bool allowGzip) |
90 | 90 | void HttpComms::request(QUrl &url, |
91 | 91 | QHttpRequestHeader &header, |
92 | 92 | int timeoutms, |
93 | | QIODevice *pData /* = NULL*/ ) |
| 93 | QIODevice *pData /* = 0*/ ) |
94 | 94 | { |
95 | 95 | quint16 port = 80; |
96 | 96 | |
… |
… |
QString HttpComms::getHttp(QString &url, |
296 | 296 | int redirectCount = 0; |
297 | 297 | int timeoutCount = 0; |
298 | 298 | QString res = ""; |
299 | | HttpComms *httpGrabber = NULL; |
| 299 | HttpComms *httpGrabber = 0; |
300 | 300 | QString hostname = ""; |
301 | 301 | |
302 | 302 | while (1) |
… |
… |
QString HttpComms::getHttp(QString &url, |
309 | 309 | |
310 | 310 | VERBOSE(VB_NETWORK, QString("getHttp: grabbing: %1").arg(qurl.toString())); |
311 | 311 | |
312 | | if (httpGrabber != NULL) |
| 312 | if (httpGrabber) |
313 | 313 | delete httpGrabber; |
314 | 314 | |
315 | 315 | httpGrabber = new HttpComms; |
… |
… |
bool HttpComms::getHttpFile(const QString& filename, QString& url, int timeoutMS |
388 | 388 | int timeoutCount = 0; |
389 | 389 | QByteArray data(0); |
390 | 390 | bool res = false; |
391 | | HttpComms *httpGrabber = NULL; |
| 391 | HttpComms *httpGrabber = 0; |
392 | 392 | QString hostname = ""; |
393 | 393 | |
394 | 394 | while (1) |
… |
… |
bool HttpComms::getHttpFile(const QString& filename, QString& url, int timeoutMS |
403 | 403 | VERBOSE(VB_NETWORK, QString("getHttp: grabbing: '%1'") |
404 | 404 | .arg(qurl.toString())); |
405 | 405 | |
406 | | if (httpGrabber != NULL) |
| 406 | if (httpGrabber) |
407 | 407 | delete httpGrabber; |
408 | 408 | |
409 | 409 | httpGrabber = new HttpComms; |
… |
… |
QString HttpComms::postHttp(QUrl &url , |
515 | 515 | int redirectCount = 0; |
516 | 516 | int timeoutCount = 0; |
517 | 517 | QString res = ""; |
518 | | HttpComms *httpGrabber = NULL; |
| 518 | HttpComms *httpGrabber = 0; |
519 | 519 | QString hostname = ""; |
520 | 520 | |
521 | 521 | QHttpRequestHeader header( "POST", url.path() + url.encodedQuery()); |
… |
… |
QString HttpComms::postHttp(QUrl &url , |
554 | 554 | |
555 | 555 | VERBOSE(VB_NETWORK, QString("postHttp: grabbing: %1").arg(url.toString())); |
556 | 556 | |
557 | | if (httpGrabber != NULL) |
| 557 | if (httpGrabber) |
558 | 558 | delete httpGrabber; |
559 | 559 | |
560 | 560 | httpGrabber = new HttpComms; |
diff --git a/mythtv/libs/libmythdb/httpcomms.h b/mythtv/libs/libmythdb/httpcomms.h
index bd11090..eaebcec 100644
a
|
b
|
class MPUBLIC HttpComms : public QObject |
60 | 60 | static QString getHttp(QString& url, int timeoutMS = 10000, |
61 | 61 | int maxRetries = 3, int maxRedirects = 3, |
62 | 62 | bool allowGzip = false, |
63 | | Credentials* webCred = NULL, |
| 63 | Credentials* webCred = 0, |
64 | 64 | bool isInQtEventThread = true); |
65 | 65 | |
66 | 66 | static bool getHttpFile(const QString& file, QString& url, int timeoutMS = 10000, |
67 | 67 | int maxRetries = 3, int maxRedirects = 3, |
68 | | bool allowGzip = false, Credentials* webCred = NULL); |
| 68 | bool allowGzip = false, Credentials* webCred = 0); |
69 | 69 | |
70 | 70 | static QString postHttp(QUrl &url, |
71 | | QHttpRequestHeader *pAddlHdr = NULL, |
72 | | QIODevice *pData = NULL, |
| 71 | QHttpRequestHeader *pAddlHdr = 0, |
| 72 | QIODevice *pData = 0, |
73 | 73 | int timeoutMS = 10000, |
74 | 74 | int maxRetries = 3, |
75 | 75 | int maxRedirects = 3, |
76 | 76 | bool allowGzip = false, |
77 | | Credentials *webCred = NULL, |
| 77 | Credentials *webCred = 0, |
78 | 78 | bool isInQtEventThread = true ); |
79 | 79 | |
80 | 80 | void request(QUrl &url, int timeoutms = -1, bool allowGzip = false); |
81 | | void request(QUrl &url, QHttpRequestHeader &header, int timeoutms = -1, QIODevice *pData = NULL ); |
| 81 | void request(QUrl &url, QHttpRequestHeader &header, int timeoutms = -1, QIODevice *pData = 0 ); |
82 | 82 | |
83 | 83 | void setCookie( const QString& cookie ) { m_cookie = cookie; } |
84 | 84 | const QString& getCookie() const { return m_cookie; } |
diff --git a/mythtv/libs/libmythdb/lcddevice.cpp b/mythtv/libs/libmythdb/lcddevice.cpp
index a627152..721b0f8 100644
a
|
b
|
static QString LOC = "lcddevice: "; |
33 | 33 | |
34 | 34 | LCD::LCD() |
35 | 35 | : QObject(), |
36 | | socket(NULL), socketLock(QMutex::Recursive), |
| 36 | socket(0), socketLock(QMutex::Recursive), |
37 | 37 | hostname("localhost"), port(6545), |
38 | 38 | bConnected(false), |
39 | 39 | |
… |
… |
LCD::LCD() |
52 | 52 | lcd_showmusic_items(), |
53 | 53 | lcd_keystring(), |
54 | 54 | |
55 | | GetLEDMask(NULL) |
| 55 | GetLEDMask(0) |
56 | 56 | { |
57 | 57 | send_buffer.clear(); last_command.clear(); |
58 | 58 | lcd_showmusic_items.clear(); lcd_keystring.clear(); |
… |
… |
LCD::LCD() |
73 | 73 | |
74 | 74 | bool LCD::m_enabled = false; |
75 | 75 | bool LCD::m_server_unavailable = false; |
76 | | class LCD *LCD::m_lcd = NULL; |
| 76 | class LCD *LCD::m_lcd = 0; |
77 | 77 | |
78 | 78 | class LCD * LCD::Get(void) |
79 | 79 | { |
80 | | if (m_enabled && m_lcd == NULL && m_server_unavailable == false) |
| 80 | if (m_enabled && !m_lcd && m_server_unavailable == false) |
81 | 81 | m_lcd = new LCD; |
82 | 82 | return m_lcd; |
83 | 83 | } |
… |
… |
void LCD::SetupLCD (void) |
90 | 90 | if (m_lcd) |
91 | 91 | { |
92 | 92 | delete m_lcd; |
93 | | m_lcd = NULL; |
| 93 | m_lcd = 0; |
94 | 94 | m_server_unavailable = false; |
95 | 95 | } |
96 | 96 | |
… |
… |
void LCD::SetupLCD (void) |
104 | 104 | if (lcd->connectToHost(lcd_host, lcd_port) == false) |
105 | 105 | { |
106 | 106 | delete m_lcd; |
107 | | m_lcd = NULL; |
| 107 | m_lcd = 0; |
108 | 108 | m_server_unavailable = false; |
109 | 109 | } |
110 | 110 | } |
… |
… |
void LCD::resetServer() |
629 | 629 | |
630 | 630 | LCD::~LCD() |
631 | 631 | { |
632 | | m_lcd = NULL; |
| 632 | m_lcd = 0; |
633 | 633 | |
634 | 634 | VERBOSE(VB_IMPORTANT|VB_EXTRA, LOC + "An LCD device is being snuffed out of " |
635 | 635 | "existence (~LCD() was called)"); |
diff --git a/mythtv/libs/libmythdb/mythdb.cpp b/mythtv/libs/libmythdb/mythdb.cpp
index d94dc79..6b6bbfd 100644
a
|
b
|
|
5 | 5 | #include "mythverbose.h" |
6 | 6 | #include "oldsettings.h" |
7 | 7 | |
8 | | static MythDB *mythdb = NULL; |
| 8 | static MythDB *mythdb = 0; |
9 | 9 | static QMutex dbLock; |
10 | 10 | |
11 | 11 | unsigned int db_messages = VB_IMPORTANT | VB_GENERAL; |
… |
… |
void MythDB::destroyMythDB(void) |
28 | 28 | dbLock.lock(); |
29 | 29 | if (mythdb) |
30 | 30 | delete mythdb; |
31 | | mythdb = NULL; |
| 31 | mythdb = 0; |
32 | 32 | dbLock.unlock(); |
33 | 33 | } |
34 | 34 | |
diff --git a/mythtv/libs/libmythdb/mythdbcon.cpp b/mythtv/libs/libmythdb/mythdbcon.cpp
index 615cbdc..801536d 100644
a
|
b
|
MDBManager::MDBManager() |
171 | 171 | |
172 | 172 | m_sem = new QSemaphore(20); |
173 | 173 | |
174 | | m_schedCon = NULL; |
175 | | m_DDCon = NULL; |
| 174 | m_schedCon = 0; |
| 175 | m_DDCon = 0; |
176 | 176 | } |
177 | 177 | |
178 | 178 | MDBManager::~MDBManager() |
… |
… |
void MDBManager::CloseDatabases() |
303 | 303 | |
304 | 304 | void InitMSqlQueryInfo(MSqlQueryInfo &qi) |
305 | 305 | { |
306 | | qi.db = NULL; |
| 306 | qi.db = 0; |
307 | 307 | qi.qsqldb = QSqlDatabase(); |
308 | 308 | qi.returnConnection = true; |
309 | 309 | } |
diff --git a/mythtv/libs/libmythdb/mythobservable.cpp b/mythtv/libs/libmythdb/mythobservable.cpp
index f97bdfb..d52bbef 100644
a
|
b
|
QObject* MythObservable::nextListener() |
35 | 35 | if (m_listener_it != m_listeners.end()) |
36 | 36 | return *m_listener_it; |
37 | 37 | else |
38 | | return NULL; |
| 38 | return 0; |
39 | 39 | } |
40 | 40 | |
41 | 41 | QList<QObject*> MythObservable::getListeners() |
diff --git a/mythtv/libs/libmythdb/mythsocket.cpp b/mythtv/libs/libmythdb/mythsocket.cpp
index bae58c7..c75f2a3 100644
a
|
b
|
bool MythSocket::DownRef(void) |
90 | 90 | |
91 | 91 | if (m_cb && ref == 0) |
92 | 92 | { |
93 | | m_cb = NULL; |
| 93 | m_cb = 0; |
94 | 94 | m_readyread_thread.RemoveFromReadyRead(this); |
95 | 95 | // thread will downref & delete obj |
96 | 96 | return true; |
… |
… |
bool MythSocket::readStringList(QStringList &list, bool quickTimeout) |
451 | 451 | tv.tv_sec = 0; |
452 | 452 | tv.tv_usec = 0; |
453 | 453 | |
454 | | int rval = select(maxfd + 1, &rfds, NULL, NULL, &tv); |
| 454 | int rval = select(maxfd + 1, &rfds, 0, 0, &tv); |
455 | 455 | if (rval) |
456 | 456 | { |
457 | 457 | if (bytesAvailable() == 0) |
… |
… |
void MythSocketThread::ShutdownReadyReadThread(void) |
670 | 670 | #ifdef USING_MINGW |
671 | 671 | if (readyreadevent) { |
672 | 672 | ::CloseHandle(readyreadevent); |
673 | | readyreadevent = NULL; |
| 673 | readyreadevent = 0; |
674 | 674 | } |
675 | 675 | #else |
676 | 676 | ::close(m_readyread_pipe[0]); |
… |
… |
void MythSocketThread::StartReadyReadThread(void) |
686 | 686 | if (m_readyread_run == false) |
687 | 687 | { |
688 | 688 | #ifdef USING_MINGW |
689 | | readyreadevent = ::CreateEvent(NULL, false, false, NULL); |
| 689 | readyreadevent = ::CreateEvent(0, false, false, 0); |
690 | 690 | assert(readyreadevent); |
691 | 691 | #else |
692 | 692 | int ret = pipe(m_readyread_pipe); |
… |
… |
void MythSocketThread::run(void) |
824 | 824 | if (sock->state() == MythSocket::Connected |
825 | 825 | && !sock->m_notifyread && !isLocked(sock->m_lock)) |
826 | 826 | { |
827 | | HANDLE hEvent = ::CreateEvent(NULL, false, false, NULL); |
| 827 | HANDLE hEvent = ::CreateEvent(0, false, false, 0); |
828 | 828 | if (!hEvent) |
829 | 829 | { |
830 | 830 | VERBOSE(VB_IMPORTANT, "MythSocket: CreateEvent failed"); |
… |
… |
void MythSocketThread::run(void) |
918 | 918 | ++it; |
919 | 919 | } |
920 | 920 | |
921 | | int rval = select(maxfd + 1, &rfds, NULL, NULL, NULL); |
| 921 | int rval = select(maxfd + 1, &rfds, 0, 0, 0); |
922 | 922 | if (rval == -1) |
923 | 923 | { |
924 | 924 | VERBOSE(VB_SOCKET, "MythSocket: select returned error"); |
diff --git a/mythtv/libs/libmythdb/mythsocket.h b/mythtv/libs/libmythdb/mythsocket.h
index dcce51c..3ef8049 100644
a
|
b
|
class MPUBLIC MythSocket : public MSocketDevice |
62 | 62 | friend void ShutdownRRT(void); |
63 | 63 | |
64 | 64 | public: |
65 | | MythSocket(int socket = -1, MythSocketCBs *cb = NULL); |
| 65 | MythSocket(int socket = -1, MythSocketCBs *cb = 0); |
66 | 66 | |
67 | 67 | enum State { |
68 | 68 | Connected, |
diff --git a/mythtv/libs/libmythdb/mythverbose.h b/mythtv/libs/libmythdb/mythverbose.h
index 1fd303b..a2afe45 100644
a
|
b
|
extern MPUBLIC unsigned int print_verbose_messages; |
137 | 137 | { \ |
138 | 138 | struct tm *tp; \ |
139 | 139 | struct timeval tv; \ |
140 | | gettimeofday(&tv, NULL); \ |
| 140 | gettimeofday(&tv, 0); \ |
141 | 141 | tp = localtime(&tv.tv_sec); \ |
142 | 142 | printf("%4d-%02d-%02d %2d:%02d:%02d.%03d ", \ |
143 | 143 | 1900+tp->tm_year, 1+tp->tm_mon, \ |
diff --git a/mythtv/libs/libmythdb/oldsettings.cpp b/mythtv/libs/libmythdb/oldsettings.cpp
index 54292d7..a8810a8 100644
a
|
b
|
Settings::Settings(QString strSettingsFile) |
36 | 36 | |
37 | 37 | Settings::~Settings() |
38 | 38 | { |
39 | | if (m_pSettings != NULL) |
| 39 | if (m_pSettings) |
40 | 40 | delete m_pSettings; |
41 | 41 | } |
42 | 42 | |