summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-04-08 15:56:40 +0200
committerTyge Løvset <[email protected]>2021-04-08 15:56:40 +0200
commit2918e1d62bdbea01b6a877f1a3318a13a5ca3e42 (patch)
tree280a12398d1ab413e75d08a82e9c13497ad92c96
parentbb998d5bf71cd0e23b941150dc78a1504aacff80 (diff)
downloadSTC-modified-2918e1d62bdbea01b6a877f1a3318a13a5ca3e42.tar.gz
STC-modified-2918e1d62bdbea01b6a877f1a3318a13a5ca3e42.zip
Fixed bug in cpque_X_emplace_n().
-rw-r--r--stc/cpque.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/stc/cpque.h b/stc/cpque.h
index 28e8113f..30197bd2 100644
--- a/stc/cpque.h
+++ b/stc/cpque.h
@@ -80,7 +80,7 @@
STC_API void CX##_push(CX* self, CX##_value_t value); \
STC_INLINE void CX##_emplace(CX* self, CX##_rawvalue_t raw) \
{CX##_push(self, ctype##_value_fromraw(raw));} \
- STC_API void CX##_emplace_n(CX *self, const CX##_rawvalue_t arr[], size_t size); \
+ STC_API void CX##_emplace_n(CX *self, const CX##_rawvalue_t arr[], size_t n); \
\
_c_implement_cpque(CX, ctype, valueCompare)
@@ -129,9 +129,11 @@
arr[c] = arr[c >> 1]; \
if (c != n) arr[c] = value; \
} \
+\
STC_API void \
- CX##_emplace_n(CX *self, const CX##_rawvalue_t arr[], size_t size) { \
- for (size_t i=0; i<size; ++i) CX##_push(self, arr[i]); \
+ CX##_emplace_n(CX *self, const CX##_rawvalue_t arr[], size_t n) { \
+ for (size_t i = 0; i < n; ++i) \
+ CX##_push(self, ctype##_value_fromraw(arr[i])); \
} \
typedef CX CX##_t