QNX: Shmemallocator: Fix Compilation Warnings
authorAngela Stegmaier <angelabaker@ti.com>
Mon, 22 May 2017 21:04:31 +0000 (16:04 -0500)
committerAngela Stegmaier <angelabaker@ti.com>
Tue, 23 May 2017 20:40:25 +0000 (15:40 -0500)
This patch fixes compilation warnings introduced with
the newer QNX version.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
qnx/src/ipc3x_dev/sharedmemallocator/resmgr/SharedMemoryAllocator.c
qnx/src/ipc3x_dev/sharedmemallocator/samples/sharedMemAllocator/usr/SharedMemAllocator.c
qnx/src/ipc3x_dev/sharedmemallocator/usr/SharedMemoryAllocator.c

index 1c7682921d08adcdc7d68591ce827c4242dd5c5d..5e4873862631eadab8f7be5330c2fe767ba6da4c 100644 (file)
@@ -580,8 +580,8 @@ SharedMemAllDrv_devctl(resmgr_context_t * ctp, io_devctl_t * msg,
 
             if(status == -1) {
                 output->result.blockID = -1;
-                output->result.phy_addr = NULL;
-                output->result.vir_addr = NULL;
+                output->result.phy_addr = 0;
+                output->result.vir_addr = 0;
                 output->apiStatus = -1;
             }
             else {
index 200977c40330645649baace1f8fa8463fc6c72cb..0787b086311c7ade19b429e1dbe9704e617a1546 100644 (file)
@@ -87,8 +87,8 @@ void clearSHM()
             if(!status) {
                 shmblocks[bufs[i].blockID] += bufs[i].size;
                 bufs[i].size = 0;
-                bufs[i].vir_addr = NULL;
-                bufs[i].phy_addr = NULL;
+                bufs[i].vir_addr = 0;
+                bufs[i].phy_addr = 0;
                 bufs[i].blockID = -1;
             }
             else
@@ -119,8 +119,8 @@ void monkeyTest()
                     if(!status) {
                         shmblocks[bufs[i].blockID] += bufs[i].size;
                         bufs[i].size = 0;
-                        bufs[i].vir_addr = NULL;
-                        bufs[i].phy_addr = NULL;
+                        bufs[i].vir_addr = 0;
+                        bufs[i].phy_addr = 0;
                         bufs[i].blockID = -1;
                     }
 
@@ -139,8 +139,8 @@ void monkeyTest()
                     if(!status) {
                         shmblocks[bufs[i].blockID] += bufs[i].size;
                         bufs[i].size = 0;
-                        bufs[i].vir_addr = NULL;
-                        bufs[i].phy_addr = NULL;
+                        bufs[i].vir_addr = 0;
+                        bufs[i].phy_addr = 0;
                         bufs[i].blockID = -1;
                     }
                 }
@@ -159,8 +159,8 @@ void monkeyTest()
                     if(!status) {
                         shmblocks[bufs[i].blockID] += bufs[i].size;
                         bufs[i].size = 0;
-                        bufs[i].vir_addr = NULL;
-                        bufs[i].phy_addr = NULL;
+                        bufs[i].vir_addr = 0;
+                        bufs[i].phy_addr = 0;
                         bufs[i].blockID = -1;
                     }
                 }
@@ -179,8 +179,8 @@ void monkeyTest()
                     if(!status) {
                         shmblocks[bufs[i].blockID] += bufs[i].size;
                         bufs[i].size = 0;
-                        bufs[i].vir_addr = NULL;
-                        bufs[i].phy_addr = NULL;
+                        bufs[i].vir_addr = 0;
+                        bufs[i].phy_addr = 0;
                         bufs[i].blockID = -1;
                     }
                 }
@@ -198,8 +198,8 @@ void monkeyTest()
                     if(!status) {
                         shmblocks[bufs[i].blockID] += bufs[i].size;
                         bufs[i].size = 0;
-                        bufs[i].vir_addr = NULL;
-                        bufs[i].phy_addr = NULL;
+                        bufs[i].vir_addr = 0;
+                        bufs[i].phy_addr = 0;
                         bufs[i].blockID = -1;
                     }
                 }
@@ -217,8 +217,8 @@ void monkeyTest()
                     if(!status) {
                         shmblocks[bufs[i].blockID] += bufs[i].size;
                         bufs[i].size = 0;
-                        bufs[i].vir_addr = NULL;
-                        bufs[i].phy_addr = NULL;
+                        bufs[i].vir_addr = 0;
+                        bufs[i].phy_addr = 0;
                         bufs[i].blockID = -1;
                     }
                 }
@@ -236,8 +236,8 @@ void monkeyTest()
                     if(!status) {
                         shmblocks[bufs[i].blockID] += bufs[i].size;
                         bufs[i].size = 0;
-                        bufs[i].vir_addr = NULL;
-                        bufs[i].phy_addr = NULL;
+                        bufs[i].vir_addr = 0;
+                        bufs[i].phy_addr = 0;
                         bufs[i].blockID = -1;
                     }
                 }
@@ -255,8 +255,8 @@ void monkeyTest()
                     if(!status) {
                         shmblocks[bufs[i].blockID] += bufs[i].size;
                         bufs[i].size = 0;
-                        bufs[i].vir_addr = NULL;
-                        bufs[i].phy_addr = NULL;
+                        bufs[i].vir_addr = 0;
+                        bufs[i].phy_addr = 0;
                         bufs[i].blockID = -1;
                     }
                 }
@@ -407,8 +407,8 @@ int main()
                         printf("\n[APP] : RELEASED REQ PASSED\n");
                         shmblocks[bufs[i].blockID] += bufs[i].size;
                         bufs[i].size = 0;
-                        bufs[i].vir_addr = NULL;
-                        bufs[i].phy_addr = NULL;
+                        bufs[i].vir_addr = 0;
+                        bufs[i].phy_addr = 0;
                         bufs[i].blockID = -1;
                         printf("\nremainng block[0] = 0x%0x", shmblocks[0]);
                         printf("\nremainng block[1] = 0x%0x", shmblocks[1]);
index a78757fc0ed6932fa80e1b501118f73d467b8c29..13444a9f3a3e494dfb2a827a2502f64bced2952a 100644 (file)
@@ -119,8 +119,8 @@ int SHM_alloc(int size, shm_buf *buf)
         slogf (42, _SLOG_DEBUG1, "\nSHM_alloc: Invalid arguments\n");
         return -1;
     }
-    buf->phy_addr = NULL;
-    buf->vir_addr = NULL;
+    buf->phy_addr = 0;
+    buf->vir_addr = 0;
     buf->blockID =  -1;
     buf->size = 0;
 
@@ -163,8 +163,8 @@ int SHM_alloc_aligned(int size, uint alignment, shm_buf *buf)
         slogf (42, _SLOG_DEBUG1, "\nSHM_alloc: Invalid arguments\n");
         return -1;
     }
-    buf->phy_addr = NULL;
-    buf->vir_addr = NULL;
+    buf->phy_addr = 0;
+    buf->vir_addr = 0;
     buf->blockID =  -1;
     buf->size = 0;
 
@@ -203,8 +203,8 @@ int SHM_alloc_fromBlock(int size, int blockID, shm_buf *buf)
     int status = 0;
     SHMAllocatorDrv_CmdArgs     cmdArgs;
 
-    buf->phy_addr = NULL;
-    buf->vir_addr = NULL;
+    buf->phy_addr = 0;
+    buf->vir_addr = 0;
     buf->blockID =  -1;
     buf->size = 0;
 
@@ -249,8 +249,8 @@ int SHM_alloc_aligned_fromBlock(int size, uint alignment, int blockID,
     int status = 0;
     SHMAllocatorDrv_CmdArgs     cmdArgs;
 
-    buf->phy_addr = NULL;
-    buf->vir_addr = NULL;
+    buf->phy_addr = 0;
+    buf->vir_addr = 0;
     buf->blockID =  -1;
     buf->size = 0;
 
@@ -306,7 +306,7 @@ int SHM_release(shm_buf *buf)
         slogf (42, _SLOG_DEBUG1, "\nSHM_release: Invalid arguments\n");
         return -1;
     }
-    if(buf->blockID < MIN_BLOCKS_IDX || buf->blockID > MAX_BLOCKS_IDX || buf->vir_addr == NULL){
+    if(buf->blockID < MIN_BLOCKS_IDX || buf->blockID > MAX_BLOCKS_IDX || buf->vir_addr == 0){
         slogf (42, _SLOG_DEBUG1, "\nSHM_release: Invalid arguments\n");
         return -1;
     }