summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3bd95ba)
raw | patch | inline | side by side (parent: 3bd95ba)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Tue, 11 Oct 2011 21:14:40 +0000 (23:14 +0200) | ||
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Thu, 3 Nov 2011 20:51:37 +0000 (21:51 +0100) |
src/screen_list.c | patch | blob | history |
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;