Parcourir la source

Fix code style of merged code

master
Bert Münnich il y a 6 ans
Parent
révision
e4fb084f26
1 fichiers modifiés avec 10 ajouts et 14 suppressions
  1. +10
    -14
      window.c

+ 10
- 14
window.c Voir le fichier

@@ -100,23 +100,20 @@ void win_check_wm_support(Display *dpy, Window root)
} }
} }


void get_xresource(Display *dpy, const char* rsc, const void* dst)
void win_res(Display *dpy, const char *rsc, const char **dst)
{ {
char *type; char *type;
XrmValue ret; XrmValue ret;
XrmDatabase db; XrmDatabase db;
char fullname[256]; char fullname[256];
char *resource_manager;
char *res_man;


XrmInitialize(); XrmInitialize();
resource_manager = XResourceManagerString(dpy);


if (resource_manager == NULL)
if ((res_man = XResourceManagerString(dpy)) == NULL)
return; return;


db = XrmGetStringDatabase(resource_manager);

if (db == NULL)
if ((db = XrmGetStringDatabase(res_man)) == NULL)
return; return;


snprintf(fullname, sizeof(fullname), ".%s", rsc); snprintf(fullname, sizeof(fullname), ".%s", rsc);
@@ -124,9 +121,8 @@ void get_xresource(Display *dpy, const char* rsc, const void* dst)


XrmGetResource(db, fullname, "String", &type, &ret); XrmGetResource(db, fullname, "String", &type, &ret);


if (ret.addr != NULL || !strncmp("String", type, 64)) {
*( (char **) dst ) = ret.addr;
}
if (ret.addr != NULL && STREQ(type, "String"))
*dst = ret.addr;
} }


#define INIT_ATOM_(atom) \ #define INIT_ATOM_(atom) \
@@ -152,10 +148,10 @@ void win_init(win_t *win)
if (setlocale(LC_CTYPE, "") == NULL || XSupportsLocale() == 0) if (setlocale(LC_CTYPE, "") == NULL || XSupportsLocale() == 0)
error(0, 0, "No locale support"); error(0, 0, "No locale support");


get_xresource(e->dpy, "background", &WIN_BG_COLOR);
get_xresource(e->dpy, "background", &BAR_FG_COLOR);
get_xresource(e->dpy, "foreground", &BAR_BG_COLOR);
get_xresource(e->dpy, "foreground", &SEL_COLOR);
win_res(e->dpy, "background", &WIN_BG_COLOR);
win_res(e->dpy, "background", &BAR_FG_COLOR);
win_res(e->dpy, "foreground", &BAR_BG_COLOR);
win_res(e->dpy, "foreground", &SEL_COLOR);


win_init_font(e, BAR_FONT); win_init_font(e, BAR_FONT);




Chargement…
Annuler
Enregistrer