|
51 | 51 | offset table for O(1) indexing. This avoids one pointer (8 bytes on 64-bit) |
52 | 52 | plus one relocation entry (~24 bytes in PIC builds) per command compared to |
53 | 53 | the traditional const char * const [] approach. */ |
54 | | -#define kFnCount_{{ fs.spec_name | spec_display }} {{ fs.commands | length }} |
| 54 | +static const uint32_t kFnCount_{{ fs.spec_name | spec_display }} = {{ fs.commands | length }}; |
55 | 55 |
|
56 | 56 | static const char kFnNameData_{{ fs.spec_name | spec_display }}[] = |
57 | 57 | {%- for cmd in fs.commands %} |
@@ -647,6 +647,7 @@ static int gloam_{{ fs.spec_name }}_find_core_{{ api }}({{ u.ctx_arg(', ') }}EGL |
647 | 647 | int gloamLoad{{ api | api_display }}Context({{ u.ctx_arg(', ') }}GloamLoadFunc getProcAddr) { |
648 | 648 | int version; |
649 | 649 | uint32_t i; |
| 650 | + GLOAM_UNUSED(kFnCount_{{ fs.spec_name | spec_display }}); |
650 | 651 |
|
651 | 652 | memset(context, 0, sizeof(*context)); |
652 | 653 |
|
@@ -687,6 +688,7 @@ int gloamLoad{{ api | api_display }}(GloamLoadFunc getProcAddr) { |
687 | 688 | int gloamLoad{{ api | api_display }}Context({{ u.ctx_arg(', ') }}EGLDisplay display, GloamLoadFunc getProcAddr) { |
688 | 689 | int version; |
689 | 690 | uint32_t i; |
| 691 | + GLOAM_UNUSED(kFnCount_{{ fs.spec_name | spec_display }}); |
690 | 692 |
|
691 | 693 | memset(context, 0, sizeof(*context)); |
692 | 694 |
|
@@ -766,6 +768,8 @@ int gloamLoad{{ api | api_display }}(Display *display, int screen, GloamLoadFunc |
766 | 768 | int gloamLoad{{ api | api_display }}Context({{ u.ctx_arg(', ') }}HDC hdc, GloamLoadFunc getProcAddr) { |
767 | 769 | int version; |
768 | 770 | uint32_t i; |
| 771 | + GLOAM_UNUSED(kFnCount_{{ fs.spec_name | spec_display }}); |
| 772 | + |
769 | 773 | memset(context, 0, sizeof(*context)); |
770 | 774 |
|
771 | 775 | /* WGL mandatory extensions must be loaded first for extension detection. */ |
@@ -835,6 +839,7 @@ int gloamLoadVulkanContextUserPtr({{ u.ctx_arg(', ') }}VkInstance instance, |
835 | 839 | GloamVkUserptrLoadFunc load, void *userptr) { |
836 | 840 | int version; |
837 | 841 | uint32_t i; |
| 842 | + GLOAM_UNUSED(kFnCount_{{ fs.spec_name | spec_display }}); |
838 | 843 | GLOAM_UNUSED(instance); |
839 | 844 | GLOAM_UNUSED(device); |
840 | 845 |
|
@@ -901,3 +906,4 @@ int gloamLoadVulkan(VkInstance instance, VkPhysicalDevice physical_device, VkDev |
901 | 906 | {% elif fs.spec_name == "wgl" -%} |
902 | 907 | #endif /* _WIN32 */ |
903 | 908 | {% endif %} |
| 909 | + |
0 commit comments