Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Standard library: right NULL definition

Use the standard definition of NULL for C and C++ languages. Fix
introduced compile errors.
  • Loading branch information...
commit 1f0627d722506fd919b8b13f1a05f33e84ee19e7 1 parent 28c5d5b
@ddejean ddejean authored
Showing with 8 additions and 3 deletions.
  1. +5 −0 kernel/CUtils/stddef.h
  2. +3 −3 kernel/Memory/PhysicalMemoryMap.cpp
View
5 kernel/CUtils/stddef.h
@@ -13,7 +13,12 @@
/**
* Definition of NULL pointer.
*/
+#ifdef __cplusplus
+#define NULL 0u
+#else
#define NULL ((void*)0)
+#endif
+
/**
* Standard size type.
View
6 kernel/Memory/PhysicalMemoryMap.cpp
@@ -40,7 +40,7 @@ PhysicalMemoryMap::PhysicalMemoryMap()
PhysicalMemoryMap::~PhysicalMemoryMap()
{
clear();
- mAllocator = 0;
+ mAllocator = NULL;
}
@@ -89,8 +89,8 @@ void PhysicalMemoryMap::clear(void)
mAllocator->free(mCurrent, sizeof(*mCurrent));
mCount--;
}
- mList = 0;
- mCurrent = 0;
+ mList = NULL;
+ mCurrent = NULL;
/* Check there's no memory leak */
assert(mCount == 0);
}
Please sign in to comment.
Something went wrong with that request. Please try again.