remove BMEMSET define, use memset instead

This commit is contained in:
Campbell Barton
2011-12-07 04:27:40 +00:00
parent 4b0b3f578c
commit 2a35e8f9c1
6 changed files with 12 additions and 14 deletions

View File

@@ -29,6 +29,10 @@
* \ingroup bke
*/
#include <string.h>
#include <limits.h>
#include <math.h>
#include "GL/glew.h"
#include "BLI_utildefines.h"
@@ -55,10 +59,6 @@
#include "GPU_extensions.h"
#include "GPU_material.h"
#include <string.h>
#include <limits.h>
#include <math.h>
/* bmesh */
#include "BKE_tessmesh.h"
#include "BLI_array.h"

View File

@@ -48,8 +48,8 @@
- joeedh
*/
void *BLI_cellalloc_malloc(long size, const char *tag);
void *BLI_cellalloc_calloc(long size, const char *tag);
void *BLI_cellalloc_malloc(int size, const char *tag);
void *BLI_cellalloc_calloc(int size, const char *tag);
void BLI_cellalloc_free(void *mem);
void BLI_cellalloc_printleaks(void);
int BLI_cellalloc_get_totblock(void);

View File

@@ -150,8 +150,8 @@ BM_INLINE void BLI_edgehash_insert(EdgeHash *eh, int v0, int v1, void *val) {
eh->nbuckets= _ehash_hashsizes[++eh->cursize];
eh->buckets= MEM_mallocN(eh->nbuckets*sizeof(*eh->buckets), "eh buckets");
BMEMSET(eh->buckets, 0, eh->nbuckets*sizeof(*eh->buckets));
memset(eh->buckets, 0, eh->nbuckets * sizeof(*eh->buckets));
for (i=0; i<nold; i++) {
for (e= old[i]; e;) {
EdgeEntry *n= e->next;

View File

@@ -302,6 +302,4 @@ do { \
# define BLI_assert(a) (void)0
#endif
#define BMEMSET(mem, val, size) {unsigned int _i, _size = (size); char *_c = (char*) mem; for (_i=0; _i<_size; _i++) *_c++ = val;}
#endif // BLI_UTILDEFINES_H

View File

@@ -69,7 +69,7 @@ typedef struct MemHeader {
//#define USE_GUARDEDALLOC
void *BLI_cellalloc_malloc(long size, const char *tag)
void *BLI_cellalloc_malloc(int size, const char *tag)
{
MemHeader *memh;
int slot = size + sizeof(MemHeader);
@@ -112,11 +112,10 @@ void *BLI_cellalloc_malloc(long size, const char *tag)
return memh + 1;
}
void *BLI_cellalloc_calloc(long size, const char *tag)
void *BLI_cellalloc_calloc(int size, const char *tag)
{
void *mem = BLI_cellalloc_malloc(size, tag);
BMEMSET(mem, 0, size);
memset(mem, 0, size);
return mem;
}

View File

@@ -32,6 +32,7 @@
* \ingroup modifiers
*/
#include <string.h>
#include "MEM_guardedalloc.h"