(xmb) De-hardcode the size of 'tabs' array

As per @bparker06's recommendation.

First element of the enum is forced to be zero, so we can add a tail to the enum that we can use to query its max length.
This commit is contained in:
rz5 2017-11-06 20:20:14 +00:00 committed by GitHub
parent 7d2e9290e2
commit 0d7f9c7cf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,7 +169,10 @@ enum
#ifdef HAVE_NETWORKING
XMB_SYSTEM_TAB_NETPLAY,
#endif
XMB_SYSTEM_TAB_ADD
XMB_SYSTEM_TAB_ADD,
/* End of this enum - use the last one to determine num of possible tabs */
XMB_SYSTEM_TAB_MAX_LENGTH
};
typedef struct xmb_handle
@ -177,7 +180,7 @@ typedef struct xmb_handle
bool mouse_show;
uint8_t system_tab_end;
uint8_t tabs[16];
uint8_t tabs[XMB_SYSTEM_TAB_MAX_LENGTH];
int depth;
int old_depth;