code cleanup: quiet uninitialized memory use warning for X11 - harmless in this case...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 8 Jul 2012 12:23:58 +0000 (12:23 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 8 Jul 2012 12:23:58 +0000 (12:23 +0000)
also some other minor changes.

intern/ghost/intern/GHOST_WindowX11.cpp
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/compositor/intern/COM_CompositorContext.cpp
source/blender/render/intern/raytrace/rayobject_qbvh.cpp
source/blender/render/intern/raytrace/rayobject_svbvh.cpp

index cdb274b0e611ccb395dbddc5b28bd4c030e8910f..285fbe966383bf2b4eff192a3e7d422a49aec7eb 100644 (file)
@@ -419,8 +419,8 @@ GHOST_WindowX11(
        x_image = XCreateImage(display, m_visual->visual, 24, ZPixmap, 0, NULL, BLENDER_ICON_WIDTH, BLENDER_ICON_HEIGHT, 32, 0);
        mask_image = XCreateImage(display, m_visual->visual, 1, ZPixmap, 0, NULL,  BLENDER_ICON_WIDTH, BLENDER_ICON_HEIGHT, 8, 0);
        
-       x_image->data = (char *)malloc(x_image->bytes_per_line * BLENDER_ICON_HEIGHT);
-       mask_image->data = (char *)malloc(mask_image->bytes_per_line * BLENDER_ICON_HEIGHT);
+       x_image->data = (char *)calloc(x_image->bytes_per_line * BLENDER_ICON_HEIGHT, 1);
+       mask_image->data = (char *)calloc(mask_image->bytes_per_line * BLENDER_ICON_HEIGHT, 1);
        
        /* copy the BLENDER_ICON_48x48x24 into the XImage */
        unsigned char *col = BLENDER_ICON_48x48x24;
@@ -429,7 +429,11 @@ GHOST_WindowX11(
                for (py = 0; py < BLENDER_ICON_HEIGHT; py++, col += 3) {
                        /* mask out pink */
                        if (col[0] == 255 && col[1] == 0 && col[2] == 255) {
+#if 0
+                               /* instead, use calloc above */
+                               XPutPixel(x_image, px, py, 0); /* avoid uninitialized memory, otherwise not needed */
                                XPutPixel(mask_image, px, py, 0);
+#endif
                        }
                        else {
                                XPutPixel(x_image, px, py, (col[0] << 16) + (col[1] << 8) + col[2]);
@@ -1143,7 +1147,6 @@ GHOST_TSuccess GHOST_WindowX11::setState(GHOST_TWindowState state)
 }
 
 #include <iostream>
-using namespace std;
 
 GHOST_TSuccess
 GHOST_WindowX11::
index 046e5c3587c22c48e8b6ea4e38d6701e4d68428c..d07f19e78e0c04384ce9b1d91ecf1b60608a00f1 100644 (file)
  *  \ingroup bli
  */
 
-
 #include <assert.h>
 
 #include "MEM_guardedalloc.h"
 
 #include "BLI_utildefines.h"
-
-
-
 #include "BLI_kdopbvh.h"
 #include "BLI_math.h"
 
@@ -45,8 +41,6 @@
 #include <omp.h>
 #endif
 
-
-
 #define MAX_TREETYPE 32
 #define DEFAULT_FIND_NEAREST_HEAP_SIZE 1024
 
index 23a15d54b80497b960a8f6e5ea21f32a252064ed..fbdb4cd6b2810870b6db5d57aea4d4d2a9b2fb03 100644 (file)
@@ -26,7 +26,7 @@
 
 CompositorContext::CompositorContext()
 {
-       this->m_rd = 0;
+       this->m_rd = NULL;
        this->m_quality = COM_QUALITY_HIGH;
        this->m_hasActiveOpenCLDevices = false;
        this->m_activegNode = NULL;
index 2e37782d04747499638b23570fa2b6e22e0a25b3..16d70297a340460c275ff69d91de537e0b32b1b8 100644 (file)
@@ -151,7 +151,7 @@ RayObject *RE_rayobject_qbvh_create(int size)
 
 #else
 
-RayObject *RE_rayobject_qbvh_create(int size)
+RayObject *RE_rayobject_qbvh_create(int UNUSED(size))
 {
        puts("WARNING: SSE disabled at compile time\n");
        return NULL;
index 697ba9ad6e28ec432976a34c0cb671a65c931a02..c1bdfa6c72c0014ad7586308c922b1bae3d89143 100644 (file)
@@ -183,7 +183,7 @@ RayObject *RE_rayobject_svbvh_create(int size)
 
 #else
 
-RayObject *RE_rayobject_svbvh_create(int size)
+RayObject *RE_rayobject_svbvh_create(int UNUSED(size))
 {
        puts("WARNING: SSE disabled at compile time\n");
        return NULL;