Author: dgorbachev
Date: Sun Feb 7 20:56:49 2010
New Revision: 45492
URL:
http://svn.reactos.org/svn/reactos?rev=45492&view=rev
Log:
Simplify a bit, remove unused macros.
Modified:
trunk/reactos/base/setup/usetup/cabinet.c
trunk/reactos/base/setup/usetup/usetup.h
Modified: trunk/reactos/base/setup/usetup/cabinet.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/cabinet.…
==============================================================================
--- trunk/reactos/base/setup/usetup/cabinet.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/cabinet.c [iso-8859-1] Sun Feb 7 20:56:49 2010
@@ -66,28 +66,22 @@
/* Needed by zlib, but we don't want the dependency on msvcrt.dll */
-
-/* round to 16 bytes + alloc at minimum 16 bytes */
-#define ROUND_SIZE(size) (max(16, ROUND_UP(size, 16)))
-
-void* __cdecl malloc(size_t _size)
-{
- size_t nSize = ROUND_SIZE(_size);
-
- if (nSize<_size)
- return NULL;
-
- return RtlAllocateHeap(ProcessHeap, HEAP_ZERO_MEMORY, nSize);
-}
-
-void __cdecl free(void* _ptr)
-{
- RtlFreeHeap(ProcessHeap, 0, _ptr);
-}
-
-void* __cdecl calloc(size_t _nmemb, size_t _size)
-{
- return (void*)RtlAllocateHeap (ProcessHeap, HEAP_ZERO_MEMORY, _size);
+void *__cdecl
+malloc(size_t size)
+{
+ return RtlAllocateHeap(ProcessHeap, HEAP_ZERO_MEMORY, size);
+}
+
+void __cdecl
+free(void *ptr)
+{
+ RtlFreeHeap(ProcessHeap, 0, ptr);
+}
+
+void *__cdecl
+calloc(size_t nmemb, size_t size)
+{
+ return (void *)RtlAllocateHeap(ProcessHeap, HEAP_ZERO_MEMORY, nmemb * size);
}
/* RAW codec */
@@ -108,9 +102,11 @@
PLONG InputLength,
PLONG OutputLength)
{
- LONG In = abs(*InputLength), Out = abs(*OutputLength);
- memcpy(OutputBuffer, InputBuffer, In < Out ? In : Out);
- *InputLength = *OutputLength = In < Out ? In : Out;
+ LONG Len = min(abs(*InputLength), abs(*OutputLength));
+
+ memcpy(OutputBuffer, InputBuffer, Len);
+ *InputLength = *OutputLength = Len;
+
return CS_SUCCESS;
}
Modified: trunk/reactos/base/setup/usetup/usetup.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.h…
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/usetup.h [iso-8859-1] Sun Feb 7 20:56:49 2010
@@ -122,12 +122,6 @@
#define POPUP_WAIT_ANY_KEY 1
#define POPUP_WAIT_ENTER 2
-#define ROUND_DOWN(n, align) \
- (((ULONG)n) & ~((align) - 1l))
-
-#define ROUND_UP(n, align) \
- ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
-
#define LIST_FOR_EACH(elem, list, type, field) \
for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \
&(elem)->field != (list) || (elem == NULL); \