|
|
@@ -49,7 +49,7 @@ static inline type* qtype##_front(qtype* p) {\
|
|
|
}\
|
|
|
\
|
|
|
static inline type* qtype##_back(qtype* p) {\
|
|
|
- return p->size == 0 ? NULL : p->ptr + p->_offset + p->size-1;\
|
|
|
+ return p->size == 0 ? NULL : p->ptr + p->_offset + p->size - 1;\
|
|
|
}\
|
|
|
\
|
|
|
static inline void qtype##_init(qtype* p, int maxsize) {\
|
|
|
@@ -72,12 +72,12 @@ static inline void qtype##_cleanup(qtype* p) {\
|
|
|
\
|
|
|
static inline void qtype##_resize(qtype* p, int maxsize) {\
|
|
|
if (maxsize == 0) maxsize = QUEUE_INIT_SIZE;\
|
|
|
- p->ptr = (type*)safe_realloc(p->ptr, sizeof(type)*maxsize, sizeof(type)*p->maxsize);\
|
|
|
+ p->ptr = (type*)safe_realloc(p->ptr, sizeof(type) * maxsize, sizeof(type) * p->maxsize);\
|
|
|
p->maxsize = maxsize;\
|
|
|
}\
|
|
|
\
|
|
|
static inline void qtype##_double_resize(qtype* p) {\
|
|
|
- qtype##_resize(p, p->maxsize*2);\
|
|
|
+ qtype##_resize(p, p->maxsize * 2);\
|
|
|
}\
|
|
|
\
|
|
|
static inline void qtype##_push_back(qtype* p, type* elem) {\
|
|
|
@@ -85,7 +85,7 @@ static inline void qtype##_push_back(qtype* p, type* elem) {\
|
|
|
qtype##_double_resize(p);\
|
|
|
}\
|
|
|
else if (p->_offset + p->size == p->maxsize) {\
|
|
|
- memmove(p->ptr, p->ptr + p->_offset, p->size);\
|
|
|
+ memmove(p->ptr, p->ptr + p->_offset, sizeof(type) * p->size);\
|
|
|
p->_offset = 0;\
|
|
|
}\
|
|
|
p->ptr[p->_offset + p->size] = *elem;\
|