aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar gingerBill 2016-05-03 23:56:20 +0100
committerGravatar gingerBill 2016-05-03 23:56:20 +0100
commite6a815749a5414c7841a9f449f86b21d85699ee8 (patch)
tree2f49b9f36b1bf3caddda02234dcfb260f6631ead
parentHuge overhaul! (diff)
Fix *_appendv bug
-rw-r--r--README.md2
-rw-r--r--gb.h9
2 files changed, 6 insertions, 5 deletions
diff --git a/README.md b/README.md
index 30b33d9..bff45a4 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ gb single-file public domain libraries for C & C++
library | latest version | category | languages | description
----------------|----------------|----------|-----------|-------------
-**gb.h** | 0.08 | misc | C, C++ | A C helper library for C & C++
+**gb.h** | 0.08a | misc | C, C++ | A C helper library for C & C++
**gb_math.h** | 0.06b | math | C, C++ | A C/C++ vector math library geared towards game development
**gb_gl.h** | 0.04b | graphics | C, C++ | A C/C++ OpenGL Helper Library
**gb_string.h** | 0.95 | strings | C, C++ | A better string library for C & C++ (this is built into gb.h too with custom allocator support!)
diff --git a/gb.h b/gb.h
index e9fe1d5..fbebc4f 100644
--- a/gb.h
+++ b/gb.h
@@ -1,4 +1,4 @@
-/* gb.h - v0.08 - Ginger Bill's C Helper Library - public domain
+/* gb.h - v0.08a - Ginger Bill's C Helper Library - public domain
- no warranty implied; use at your own risk
This is a single header file with a bunch of useful stuff
@@ -26,6 +26,7 @@ Conventions used:
Version History:
+ 0.08a - Fix *_appendv bug
0.08 - Huge Overhaul!
0.07a - Fix alignment in gb_heap_allocator_proc
0.07 - Hash Table and Hashing Functions
@@ -1142,10 +1143,10 @@ typedef struct gbBufferHeader {
#define gb_buffer_append(x, item) do { (x)[gb_buffer_count(x)++] = (item); } while (0)
-#define gb_buffer_appednv(x, items, item_count) do { \
+#define gb_buffer_appendv(x, items, item_count) do { \
GB_ASSERT(gb_size_of(*(items)) == gb_size_of(*(x))); \
GB_ASSERT(gb_buffer_count(x)+item_count <= gb_buffer_capacity(x)); \
- gb_memcopy((x)[gb_buffer_count(x)], (items), gb_size_of(*(x))*(item_count)); \
+ gb_memcopy(&(x)[gb_buffer_count(x)], (items), gb_size_of(*(x))*(item_count)); \
gb_buffer_count(x) += (item_count); \
} while (0)
@@ -1286,7 +1287,7 @@ GB_DEF void *gb__set_array_capacity(void *array, isize capacity, isize element_s
GB_ASSERT(gb_size_of((items)[0]) == gb_size_of((x)[0])); \
if (gb__ah->capacity < gb__ah->count+(item_count)) \
gb_array_grow(x, gb__ah->count+(item_count)); \
- gb_memcopy((x)[gb__ah->count], (items), gb_size_of((x)[0])*(item_count));\
+ gb_memcopy(&(x)[gb__ah->count], (items), gb_size_of((x)[0])*(item_count));\
gb__ah->count += (item_count); \
} while (0)