diff options
author | Chad Versace <chad.versace@intel.com> | 2015-01-04 13:36:08 -0800 |
---|---|---|
committer | Chad Versace <chad.versace@intel.com> | 2015-01-27 09:36:05 -0800 |
commit | 5e8b6ed53cdfbf34b610a9f989dd4dd3b9b39e32 (patch) | |
tree | 2d91b928b424d8b0b0dbc0d89e5bb669ebce5d12 | |
parent | abc8fbf5d122640c8e575c5784758aa60a03e3d2 (diff) |
core: Define intptr_t variants of wcore_attrib_list functions
When designing the original Waffle 1.0 API, I made a mistake when
I chose to declare attribute lists as arrays of int32_t. Instead, they
should have been arrays of intptr_t.
A new public function, waffle_window_create2, will have a `const
intptr_t attrib_list[]` parameter. Therefore waffle needs intptr_t
variants of the wcore_attrib_list functions.
Signed-off-by: Chad Versace <chad.versace@intel.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com> (msvc/wgl)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r-- | src/waffle/core/wcore_attrib_list.c | 6 | ||||
-rw-r--r-- | src/waffle/core/wcore_attrib_list.h | 23 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/waffle/core/wcore_attrib_list.c b/src/waffle/core/wcore_attrib_list.c index f8c2e6d..abba921 100644 --- a/src/waffle/core/wcore_attrib_list.c +++ b/src/waffle/core/wcore_attrib_list.c @@ -113,3 +113,9 @@ WCORE_ATTRIB_LIST_COMMON_FUNCS(int32_t, wcore_attrib_list32_get, wcore_attrib_list32_get_with_default, wcore_attrib_list32_update) + +WCORE_ATTRIB_LIST_COMMON_FUNCS(intptr_t, + wcore_attrib_list_length, + wcore_attrib_list_get, + wcore_attrib_list_get_with_default, + wcore_attrib_list_update) diff --git a/src/waffle/core/wcore_attrib_list.h b/src/waffle/core/wcore_attrib_list.h index 15bd8ba..8d49d10 100644 --- a/src/waffle/core/wcore_attrib_list.h +++ b/src/waffle/core/wcore_attrib_list.h @@ -28,6 +28,29 @@ #include <stdbool.h> #include <stddef.h> #include <stdint.h> +#include <stdlib.h> + +size_t +wcore_attrib_list_length(const intptr_t attrib_list[]); + +bool +wcore_attrib_list_get( + const intptr_t *attrib_list, + intptr_t key, + intptr_t *value); + +bool +wcore_attrib_list_get_with_default( + const intptr_t attrib_list[], + intptr_t key, + intptr_t *value, + intptr_t default_value); + +bool +wcore_attrib_list_update( + intptr_t *attrib_list, + intptr_t key, + intptr_t value); size_t wcore_attrib_list32_length(const int32_t attrib_list[]); |