diff --git a/src/screen_list.c b/src/screen_list.c
index 4afbceac04ff5a55dbfc8b429020770fac77688d..a6bbf8df0587412f135d75c7d3ea8ce2534ad5bb 100644 (file)
--- a/src/screen_list.c
+++ b/src/screen_list.c
#endif
};
-static const unsigned NUM_SCREENS = sizeof(screens) / sizeof(screens[0]);
-
void
screen_list_init(WINDOW *w, unsigned cols, unsigned rows)
{
unsigned i;
- for (i = 0; i < NUM_SCREENS; ++i) {
+ for (i = 0; i < G_N_ELEMENTS(screens); ++i) {
const struct screen_functions *sf = screens[i].functions;
if (sf->init)
{
unsigned i;
- for (i = 0; i < NUM_SCREENS; ++i) {
+ for (i = 0; i < G_N_ELEMENTS(screens); ++i) {
const struct screen_functions *sf = screens[i].functions;
if (sf->exit)
{
unsigned i;
- for (i = 0; i < NUM_SCREENS; ++i) {
+ for (i = 0; i < G_N_ELEMENTS(screens); ++i) {
const struct screen_functions *sf = screens[i].functions;
if (sf->resize)
{
unsigned i;
- for (i = 0; i < NUM_SCREENS; ++i)
+ for (i = 0; i < G_N_ELEMENTS(screens); ++i)
if (screens[i].functions == sf)
return screens[i].name;
{
unsigned i;
- for (i = 0; i < NUM_SCREENS; ++i)
+ for (i = 0; i < G_N_ELEMENTS(screens); ++i)
if (strcmp(name, screens[i].name) == 0)
return screens[i].functions;