mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
general: Don't use NULL where not appropriate
This commit is contained in:
parent
d422d74abb
commit
92d2f5e195
@ -1935,7 +1935,7 @@ fill_d3d_texture_pixels(DXScreenData &scrn, bool compress_texture) {
|
||||
scaled *= 255;
|
||||
color = D3DCOLOR_RGBA((int)scaled[0], (int)scaled[1], (int)scaled[2], (int)scaled[3]);
|
||||
flags = D3DCLEAR_TARGET;
|
||||
if (device -> Clear (NULL, NULL, flags, color, 0.0f, 0) == D3D_OK) {
|
||||
if (device -> Clear (0, NULL, flags, color, 0.0f, 0) == D3D_OK) {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -385,7 +385,7 @@ atomic_compare_and_exchange_contents(const Filename &file, string &orig_contents
|
||||
// First ensure that the file exists to validate its case.
|
||||
if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
|
||||
if (!has_file(file)) {
|
||||
return NULL;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif // WIN32
|
||||
@ -402,7 +402,7 @@ atomic_read_contents(const Filename &file, string &contents) const {
|
||||
// First ensure that the file exists to validate its case.
|
||||
if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
|
||||
if (!has_file(file)) {
|
||||
return NULL;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif // WIN32
|
||||
|
@ -306,7 +306,7 @@ read_data(unsigned char *data, size_t size, VertexDataSaveBlock *block) {
|
||||
<< "Error reading " << size
|
||||
<< " bytes from save file, windows error code 0x" << hex
|
||||
<< error << dec << ".\n";
|
||||
return NULL;
|
||||
return false;
|
||||
}
|
||||
success = GetOverlappedResult(_handle, &overlapped, &bytes_read, false);
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ find_all_microphones_ds() {
|
||||
format.nBlockAlign = 2 * chan;
|
||||
format.wBitsPerSample = 16;
|
||||
format.cbSize = 0;
|
||||
stat = waveInOpen(NULL, i, &format, NULL, NULL, WAVE_FORMAT_QUERY);
|
||||
stat = waveInOpen(NULL, i, &format, 0, 0, WAVE_FORMAT_QUERY);
|
||||
if (stat == MMSYSERR_NOERROR) {
|
||||
PT(MicrophoneAudioDS) p = new MicrophoneAudioDS();
|
||||
ostringstream name;
|
||||
@ -248,7 +248,7 @@ open() {
|
||||
format.cbSize = 0;
|
||||
|
||||
HWAVEIN hwav;
|
||||
MMRESULT stat = waveInOpen(&hwav, _device_id, &format, NULL, NULL, CALLBACK_NULL);
|
||||
MMRESULT stat = waveInOpen(&hwav, _device_id, &format, 0, 0, CALLBACK_NULL);
|
||||
|
||||
if (stat != MMSYSERR_NOERROR) {
|
||||
delete_buffers(buffers);
|
||||
|
@ -594,7 +594,7 @@ make_context(HDC hdc) {
|
||||
// what kind of OpenGL context we would like.
|
||||
int attrib_list[32];
|
||||
int n = 0;
|
||||
attrib_list[0] = NULL;
|
||||
attrib_list[0] = 0;
|
||||
|
||||
if (gl_version.get_num_words() > 0) {
|
||||
attrib_list[n++] = WGL_CONTEXT_MAJOR_VERSION_ARB;
|
||||
@ -612,7 +612,7 @@ make_context(HDC hdc) {
|
||||
attrib_list[n++] = WGL_CONTEXT_PROFILE_MASK_ARB;
|
||||
attrib_list[n++] = WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
|
||||
#endif
|
||||
attrib_list[n] = NULL;
|
||||
attrib_list[n] = 0;
|
||||
|
||||
_context = _wglCreateContextAttribsARB(hdc, 0, attrib_list);
|
||||
} else {
|
||||
|
@ -1870,7 +1870,7 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
|
||||
lptstr = (char *) GlobalLock(hglb);
|
||||
if (lptstr != NULL) {
|
||||
char *pChar;
|
||||
for (pChar=lptstr; *pChar!=NULL; pChar++) {
|
||||
for (pChar=lptstr; *pChar; pChar++) {
|
||||
_input_devices[0].keystroke((uchar)*pChar);
|
||||
}
|
||||
GlobalUnlock(hglb);
|
||||
@ -2159,12 +2159,12 @@ update_cursor_window(WinGraphicsWindow *to_window) {
|
||||
// We are leaving a graphics window; we should restore the Win2000
|
||||
// effects.
|
||||
if (_got_saved_params) {
|
||||
SystemParametersInfo(SPI_SETMOUSETRAILS, NULL,
|
||||
(PVOID)_saved_mouse_trails, NULL);
|
||||
SystemParametersInfo(SPI_SETCURSORSHADOW, NULL,
|
||||
(PVOID)_saved_cursor_shadow, NULL);
|
||||
SystemParametersInfo(SPI_SETMOUSEVANISH, NULL,
|
||||
(PVOID)_saved_mouse_vanish, NULL);
|
||||
SystemParametersInfo(SPI_SETMOUSETRAILS, 0,
|
||||
(PVOID)_saved_mouse_trails, 0);
|
||||
SystemParametersInfo(SPI_SETCURSORSHADOW, 0,
|
||||
(PVOID)_saved_cursor_shadow, 0);
|
||||
SystemParametersInfo(SPI_SETMOUSEVANISH, 0,
|
||||
(PVOID)_saved_mouse_vanish, 0);
|
||||
_got_saved_params = false;
|
||||
}
|
||||
|
||||
@ -2178,17 +2178,17 @@ update_cursor_window(WinGraphicsWindow *to_window) {
|
||||
// These parameters are only defined for Win2000XP, but they should just
|
||||
// cause a silent error on earlier OS's, which is OK.
|
||||
if (!_got_saved_params) {
|
||||
SystemParametersInfo(SPI_GETMOUSETRAILS, NULL,
|
||||
&_saved_mouse_trails, NULL);
|
||||
SystemParametersInfo(SPI_GETCURSORSHADOW, NULL,
|
||||
&_saved_cursor_shadow, NULL);
|
||||
SystemParametersInfo(SPI_GETMOUSEVANISH, NULL,
|
||||
&_saved_mouse_vanish, NULL);
|
||||
SystemParametersInfo(SPI_GETMOUSETRAILS, 0,
|
||||
&_saved_mouse_trails, 0);
|
||||
SystemParametersInfo(SPI_GETCURSORSHADOW, 0,
|
||||
&_saved_cursor_shadow, 0);
|
||||
SystemParametersInfo(SPI_GETMOUSEVANISH, 0,
|
||||
&_saved_mouse_vanish, 0);
|
||||
_got_saved_params = true;
|
||||
|
||||
SystemParametersInfo(SPI_SETMOUSETRAILS, NULL, (PVOID)0, NULL);
|
||||
SystemParametersInfo(SPI_SETCURSORSHADOW, NULL, (PVOID)false, NULL);
|
||||
SystemParametersInfo(SPI_SETMOUSEVANISH, NULL, (PVOID)false, NULL);
|
||||
SystemParametersInfo(SPI_SETMOUSETRAILS, 0, (PVOID)0, 0);
|
||||
SystemParametersInfo(SPI_SETCURSORSHADOW, 0, (PVOID)false, 0);
|
||||
SystemParametersInfo(SPI_SETMOUSEVANISH, 0, (PVOID)false, 0);
|
||||
}
|
||||
|
||||
SetCursor(to_window->_cursor);
|
||||
|
Loading…
x
Reference in New Issue
Block a user