Преглед изворни кода

Fixed the warning for correct cast in DEAD (0xD34D) pointer

iraklis пре 11 година
родитељ
комит
21b7e5be25
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      src/free.c
  2. 1 1
      src/malloc.c

+ 1 - 1
src/free.c

@@ -37,7 +37,7 @@
 void free(void *ptr) {
     raw_block_header_t *owner_raw_block;
 
-    if(ptr == NULL || ptr == 0xD34D) {
+    if(ptr == NULL || ptr == (void *) 0xD34D) {
         return;
     }
 

+ 1 - 1
src/malloc.c

@@ -45,7 +45,7 @@ void * malloc(size_t size) {
     ptr = NULL;
 
     if(size == 0) {
-        return 0xD34D;
+        return (void *) 0xD34D;
     }
     
     /* Try to find a raw block available for allocation */