mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-19 06:40:49 +00:00
Indentation
This commit is contained in:
parent
0b322a8944
commit
fcc83306f1
1 changed files with 20 additions and 20 deletions
40
gmqcc.h
40
gmqcc.h
|
@ -125,26 +125,26 @@ char *util_strdup (const char *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define VECTOR_MAKE(T,N) \
|
#define VECTOR_MAKE(T,N) \
|
||||||
T* N##_data = NULL; \
|
T* N##_data = NULL; \
|
||||||
long N##_elements = 0; \
|
long N##_elements = 0; \
|
||||||
long N##_allocated = 0; \
|
long N##_allocated = 0; \
|
||||||
int N##_add(T element) { \
|
int N##_add(T element) { \
|
||||||
if (N##_elements == N##_allocated) { \
|
if (N##_elements == N##_allocated) { \
|
||||||
if (N##_allocated == 0) { \
|
if (N##_allocated == 0) { \
|
||||||
N##_allocated = 12; \
|
N##_allocated = 12; \
|
||||||
} else { \
|
} else { \
|
||||||
N##_allocated *= 2; \
|
N##_allocated *= 2; \
|
||||||
} \
|
} \
|
||||||
void *temp = realloc(N##_data, (N##_allocated * sizeof(T))); \
|
void *temp = realloc(N##_data, (N##_allocated * sizeof(T))); \
|
||||||
if (!temp) { \
|
if (!temp) { \
|
||||||
free(temp); \
|
free(temp); \
|
||||||
return -1; \
|
return -1; \
|
||||||
} \
|
} \
|
||||||
N##_data = (T*)temp; \
|
N##_data = (T*)temp; \
|
||||||
} \
|
} \
|
||||||
N##_data[N##_elements] = element; \
|
N##_data[N##_elements] = element; \
|
||||||
return N##_elements++; \
|
return N##_elements++; \
|
||||||
}
|
}
|
||||||
|
|
||||||
//===================================================================
|
//===================================================================
|
||||||
//=========================== code.c ================================
|
//=========================== code.c ================================
|
||||||
|
|
Loading…
Reference in a new issue