code cleanup: 0 --> NULL
authorCampbell Barton <ideasman42@gmail.com>
Fri, 8 Mar 2013 06:32:00 +0000 (06:32 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 8 Mar 2013 06:32:00 +0000 (06:32 +0000)
16 files changed:
intern/audaspace/FX/AUD_CallbackIIRFilterReader.h
intern/ghost/GHOST_ISystem.h
intern/ghost/intern/GHOST_Event.h
intern/ghost/intern/GHOST_EventManager.cpp
intern/ghost/intern/GHOST_EventManager.h
intern/ghost/intern/GHOST_Path-api.cpp
intern/ghost/intern/GHOST_System.cpp
intern/ghost/intern/GHOST_System.h
intern/ghost/intern/GHOST_TimerManager.cpp
intern/ghost/intern/GHOST_TimerTask.h
intern/memutil/MEM_Allocator.h
intern/memutil/MEM_CacheLimiter.h
intern/memutil/intern/MEM_CacheLimiterC-Api.cpp
intern/string/intern/STR_String.cpp
source/blender/render/intern/raytrace/rayobject.cpp
source/blender/render/intern/raytrace/rayobject_rtbuild.cpp

index d9df65f..66f82ba 100644 (file)
@@ -77,7 +77,7 @@ public:
        AUD_CallbackIIRFilterReader(boost::shared_ptr<AUD_IReader> reader, int in, int out,
                                                                doFilterIIR doFilter,
                                                                endFilterIIR endFilter = 0,
-                                                               void* data = 0);
+                                                               void* data = NULL);
 
        virtual ~AUD_CallbackIIRFilterReader();
 
index 37e82c2..137926b 100644 (file)
@@ -201,7 +201,7 @@ public:
        virtual GHOST_ITimerTask *installTimer(GHOST_TUns64 delay,
                                               GHOST_TUns64 interval,
                                               GHOST_TimerProcPtr timerProc,
-                                              GHOST_TUserDataPtr userData = 0) = 0;
+                                              GHOST_TUserDataPtr userData = NULL) = 0;
 
        /**
         * Removes a timer.
index c9a51f2..ea4d603 100644 (file)
@@ -51,7 +51,7 @@ public:
         * \param window The generating window (or NULL if system event).
         */
        GHOST_Event(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow *window)
-               : m_type(type), m_time(msec), m_window(window), m_data(0)
+               : m_type(type), m_time(msec), m_window(window), m_data(NULL)
        {
        }
 
index 014eef8..2fddfe2 100644 (file)
@@ -81,7 +81,7 @@ GHOST_TUns32 GHOST_EventManager::getNumEvents(GHOST_TEventType type)
 
 GHOST_IEvent *GHOST_EventManager::peekEvent()
 {
-       GHOST_IEvent *event = 0;
+       GHOST_IEvent *event = NULL;
        if (m_events.empty() == false) {
                event = m_events.back();
        }
index fea8214..8e513b4 100644 (file)
@@ -141,7 +141,7 @@ public:
        virtual void
        removeTypeEvents(
            GHOST_TEventType type,
-           GHOST_IWindow *window = 0
+           GHOST_IWindow *window = NULL
            );
 
 protected:
index 2bc5851..b61d321 100644 (file)
@@ -48,19 +48,19 @@ GHOST_TSuccess GHOST_DisposeSystemPaths(void)
 const GHOST_TUns8 *GHOST_getSystemDir(int version, const char *versionstr)
 {
        GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
-       return systemPaths ? systemPaths->getSystemDir(version, versionstr) : 0;
+       return systemPaths ? systemPaths->getSystemDir(version, versionstr) : NULL;
 }
 
 const GHOST_TUns8 *GHOST_getUserDir(int version, const char *versionstr)
 {
        GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
-       return systemPaths ? systemPaths->getUserDir(version, versionstr) : 0; /* shouldn't be NULL */
+       return systemPaths ? systemPaths->getUserDir(version, versionstr) : NULL; /* shouldn't be NULL */
 }
 
 const GHOST_TUns8 *GHOST_getBinaryDir()
 {
        GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
-       return systemPaths ? systemPaths->getBinaryDir() : 0;  /* shouldn't be NULL */
+       return systemPaths ? systemPaths->getBinaryDir() : NULL;  /* shouldn't be NULL */
 }
 
 void GHOST_addToSystemRecentFiles(const char *filename)
index 5405fe7..023c595 100644 (file)
 
 GHOST_System::GHOST_System()
        : m_nativePixel(false),
-       m_displayManager(0),
-       m_timerManager(0),
-       m_windowManager(0),
-       m_eventManager(0)
+       m_displayManager(NULL),
+       m_timerManager(NULL),
+       m_windowManager(NULL),
+       m_eventManager(NULL)
 #ifdef WITH_INPUT_NDOF
        , m_ndofManager(0)
 #endif
@@ -324,19 +324,19 @@ GHOST_TSuccess GHOST_System::exit()
        }
        if (m_displayManager) {
                delete m_displayManager;
-               m_displayManager = 0;
+               m_displayManager = NULL;
        }
        if (m_windowManager) {
                delete m_windowManager;
-               m_windowManager = 0;
+               m_windowManager = NULL;
        }
        if (m_timerManager) {
                delete m_timerManager;
-               m_timerManager = 0;
+               m_timerManager = NULL;
        }
        if (m_eventManager) {
                delete m_eventManager;
-               m_eventManager = 0;
+               m_eventManager = NULL;
        }
 #ifdef WITH_INPUT_NDOF
        if (m_ndofManager) {
index 0d18dfe..57aa0a3 100644 (file)
@@ -100,7 +100,7 @@ public:
        virtual GHOST_ITimerTask *installTimer(GHOST_TUns64 delay,
                                               GHOST_TUns64 interval,
                                               GHOST_TimerProcPtr timerProc,
-                                              GHOST_TUserDataPtr userData = 0);
+                                              GHOST_TUserDataPtr userData = NULL);
 
        /**
         * Removes a timer.
index 6013599..8cba060 100644 (file)
@@ -90,7 +90,7 @@ GHOST_TSuccess GHOST_TimerManager::removeTimer(GHOST_TimerTask *timer)
                // Remove the timer task
                m_timers.erase(iter);
                delete timer;
-               timer = 0;
+               timer = NULL;
                success = GHOST_kSuccess;
        }
        else {
index 0731bc0..e8f5ecd 100644 (file)
@@ -54,7 +54,7 @@ public:
        GHOST_TimerTask(GHOST_TUns64 start,
                        GHOST_TUns64 interval,
                        GHOST_TimerProcPtr timerProc,
-                       GHOST_TUserDataPtr userData = 0)
+                       GHOST_TUserDataPtr userData = NULL)
                : m_start(start),
                m_interval(interval),
                m_next(start),
index 0020094..b4c0559 100644 (file)
@@ -63,7 +63,7 @@ struct MEM_Allocator
        // NB: __n is permitted to be 0.  The C++ standard says nothing
        // about what the return value is when __n == 0.
        _Tp* allocate(size_type __n, const void* = 0) {
-               _Tp* __ret = 0;
+               _Tp* __ret = NULL;
                if (__n)
                        __ret = static_cast<_Tp*>(
                                MEM_mallocN(__n * sizeof(_Tp),
index daf66dc..4e77692 100644 (file)
@@ -108,7 +108,7 @@ public:
        bool destroy_if_possible() {
                if (can_destroy()) {
                        delete data;
-                       data = 0;
+                       data = NULL;
                        unmanage();
                        return true;
                }
index 7a19543..f946c97 100644 (file)
@@ -128,7 +128,7 @@ MEM_CacheLimiterCClass::~MEM_CacheLimiterCClass()
 {
        // should not happen, but don't leak memory in this case...
        for (list_t::iterator it = cclass_list.begin(); it != cclass_list.end(); it++) {
-               (*it)->set_data(0);
+               (*it)->set_data(NULL);
 
                delete *it;
        }
index 283b443..4ea4513 100644 (file)
@@ -106,7 +106,7 @@ STR_String::STR_String(const char *str)
                this->m_data[this->m_len] = 0;
        }
        else {
-               this->m_data = 0;
+               this->m_data = NULL;
                this->m_len = 0;
                this->m_max = 8;
        }
index b31aff8..9e63950 100644 (file)
@@ -87,7 +87,7 @@ MALWAYS_INLINE void rayface_from_vlak(RayFace *rayface, ObjectInstanceRen *obi,
 
 RayObject *RE_rayface_from_vlak(RayFace *rayface, ObjectInstanceRen *obi, VlakRen *vlr)
 {
-       return rayface_from_coords(rayface, obi, vlr, vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4 ? vlr->v4->co : 0);
+       return rayface_from_coords(rayface, obi, vlr, vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4 ? vlr->v4->co : NULL);
 }
 
 RayObject *RE_rayface_from_coords(RayFace *rayface, void *ob, void *face, float *v1, float *v2, float *v3, float *v4)
index 4195b10..1d67a8c 100644 (file)
@@ -50,15 +50,15 @@ static bool selected_node(RTBuilder::Object *node)
 static void rtbuild_init(RTBuilder *b)
 {
        b->split_axis = -1;
-       b->primitives.begin   = 0;
-       b->primitives.end     = 0;
+       b->primitives.begin   = NULL;
+       b->primitives.end     = NULL;
        b->primitives.maxsize = 0;
        
        for (int i = 0; i < RTBUILD_MAX_CHILDS; i++)
                b->child_offset[i] = 0;
 
        for (int i = 0; i < 3; i++)
-               b->sorted_begin[i] = b->sorted_end[i] = 0;
+               b->sorted_begin[i] = b->sorted_end[i] = NULL;
                
        INIT_MINMAX(b->bb, b->bb + 3);
 }
@@ -178,8 +178,8 @@ RTBuilder *rtbuild_get_child(RTBuilder *b, int child, RTBuilder *tmp)
                        tmp->sorted_end[i] = b->sorted_begin[i] +  b->child_offset[child + 1];
                }
                else {
-                       tmp->sorted_begin[i] = 0;
-                       tmp->sorted_end[i] = 0;
+                       tmp->sorted_begin[i] = NULL;
+                       tmp->sorted_end[i] = NULL;
                }
        
        return tmp;