Changeset 4022 for neercs


Ignore:
Timestamp:
Nov 23, 2009, 2:09:54 PM (10 years ago)
Author:
Pascal Terjan
Message:
  • Factorize that a boolean option is true when it is "true" or "1"
File:
1 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/configuration.c

    r4014 r4022  
    367367
    368368#define IS_OPTION(t) (!strncmp(argv, t, strlen(argv)))
     369#define IS_OPTION_TRUE (IS_OPTION("true") || IS_OPTION("1"))
     370
    369371int set_window_manager(const char *argv, struct screen_list *screen_list)
    370372{
     
    393395int set_thumbnails(const char *argv, struct screen_list *screen_list)
    394396{
    395     if (IS_OPTION("true") || IS_OPTION("1"))
     397    if (IS_OPTION_TRUE)
    396398        screen_list->mini = 1;
    397399    else
     
    403405int set_status_bar(const char *argv, struct screen_list *screen_list)
    404406{
    405     if (IS_OPTION("true") || IS_OPTION("1"))
     407    if (IS_OPTION_TRUE)
    406408        screen_list->status = 1;
    407409    else
     
    434436int set_lock_on_detach(const char *argv, struct screen_list *screen_list)
    435437{
    436     if (IS_OPTION("true") || IS_OPTION("1"))
     438    if (IS_OPTION_TRUE)
    437439        screen_list->lock_on_detach = 1;
    438440    else
     
    443445int set_eyecandy(const char *argv, struct screen_list *screen_list)
    444446{
    445     if (IS_OPTION("true") || IS_OPTION("1"))
     447    if (IS_OPTION_TRUE)
    446448        screen_list->eyecandy = 1;
    447449    else
     
    452454int set_border(const char *argv, struct screen_list *screen_list)
    453455{
    454     if (IS_OPTION("true") || IS_OPTION("1"))
     456    if (IS_OPTION_TRUE)
    455457        screen_list->border_size = 1;
    456458    else
Note: See TracChangeset for help on using the changeset viewer.