commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 01/01: volk: use the explicit casting for a


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/01: volk: use the explicit casting for all OSes, not just MSVC.
Date: Fri, 7 Mar 2014 20:03:59 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch maint
in repository gnuradio.

commit 6b49aa023681934ba1b5fd16bb62893b3051deb2
Author: Tom Rondeau <address@hidden>
Date:   Fri Mar 7 15:02:33 2014 -0500

    volk: use the explicit casting for all OSes, not just MSVC.
---
 volk/lib/volk_malloc.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/volk/lib/volk_malloc.c b/volk/lib/volk_malloc.c
index 65cb5eb..b2b77dd 100644
--- a/volk/lib/volk_malloc.c
+++ b/volk/lib/volk_malloc.c
@@ -24,7 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-/* 
+/*
  * For #defines used to determine support for allocation functions,
  * see: http://linux.die.net/man/3/aligned_alloc
 */
@@ -111,11 +111,7 @@ volk_malloc(size_t size, size_t alignment)
   // Find and return the first aligned boundary of the pointer
   void *aptr = ptr;
   if((unsigned long)ptr % alignment != 0)
-#ifdef _MSC_VER
     aptr = (void*)((unsigned long)ptr + (alignment - ((unsigned long)ptr % 
alignment)));
-#else
-    aptr = ptr + (alignment - ((unsigned long)ptr % alignment));
-#endif
 
   // Store original pointer and aligned pointers
   mbuf *n = (mbuf*)malloc(sizeof(mbuf));
@@ -128,7 +124,7 @@ volk_malloc(size_t size, size_t alignment)
   else {
     volk_last_ptr->next = n;
   }
-  volk_last_ptr = n;  
+  volk_last_ptr = n;
   volk_nptrs++;
 
   return aptr;
@@ -139,7 +135,7 @@ void volk_free(void *ptr)
   unsigned long aptr = (unsigned long)ptr;
   mbuf *prev = volk_first_ptr;
   mbuf *p = volk_first_ptr;
-  
+
   // Look for the aligned pointer until we either find it or have
   // walked the entire list of allocated pointers
   while(p != NULL) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]