wmbiff: Trivial code cleanups

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
Carlos R. Mafra 2011-03-21 17:01:28 +01:00
parent d76ad29da2
commit 6f93d12d09

View file

@ -59,8 +59,8 @@ static mbox_t mbox[MAX_NUM_MAILBOXES];
/* this is the normal pixmap. */ /* this is the normal pixmap. */
static const char *skin_filename = "wmbiff-master-led.xpm"; static const char *skin_filename = "wmbiff-master-led.xpm";
/* global notify action taken (if globalnotify option is set) */ /* global notify action taken (if globalnotify option is set) */
/*@null@*/
static const char *globalnotify = NULL; static const char *globalnotify = NULL;
/* path to search for pixmaps */ /* path to search for pixmaps */
/* /usr/share/wmbiff should have the default pixmap. */ /* /usr/share/wmbiff should have the default pixmap. */
/* /usr/local/share/wmbiff if compiled locally. */ /* /usr/local/share/wmbiff if compiled locally. */
@ -68,12 +68,10 @@ static const char *globalnotify = NULL;
/* . is there for development. */ /* . is there for development. */
static const char *skin_search_path = DEFAULT_SKIN_PATH; static const char *skin_search_path = DEFAULT_SKIN_PATH;
/* for gnutls */ /* for gnutls */
/*@null@*/
const char *certificate_filename = NULL; const char *certificate_filename = NULL;
/* it could be argued that a better default exists. */ /* it could be argued that a better default exists. */
#define DEFAULT_FONT "-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*" #define DEFAULT_FONT "-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*"
/*@null@*/
static const char *font = NULL; static const char *font = NULL;
int debug_default = DEBUG_ERROR; int debug_default = DEBUG_ERROR;
@ -452,17 +450,6 @@ static void init_biff(char *config_file)
if (gcry_check_version("1.1.42") == NULL) { if (gcry_check_version("1.1.42") == NULL) {
DMA(DEBUG_ERROR, "Error: incompatible gcrypt version.\n"); DMA(DEBUG_ERROR, "Error: incompatible gcrypt version.\n");
} }
/*
if ((rc = gcry_control(GCRYCTL_INIT_SECMEM, 16384, 0)) != 0) {
DMA(DEBUG_ERROR,
"Error: gcry_control() to initialize secure memory returned non-zero: %d\n"
" Message: %s\n"
" libgcrypt version: %s\n"
" recovering: will fail later if using CRAM-MD5 or APOP authentication.\n",
rc, gcry_strerror(rc), gcry_check_version(NULL));
};
*/
#endif #endif
DMA(DEBUG_INFO, "config_file = %s.\n", config_file); DMA(DEBUG_INFO, "config_file = %s.\n", config_file);
@ -564,8 +551,7 @@ int exists(const char *filename)
/* acts like execvp, with code inspired by it */ /* acts like execvp, with code inspired by it */
/* mustfree */ /* mustfree */
static char *search_path(const char *path, /*@notnull@ */ static char *search_path(const char *path, const char *find_me)
const char *find_me)
{ {
char *buf; char *buf;
const char *p; const char *p;
@ -879,9 +865,8 @@ static int periodic_mail_check(void)
} }
/* exec globalnotify if there was any new mail */ /* exec globalnotify if there was any new mail */
if (NewMail == 1) { if (NewMail == 1)
execnotify(globalnotify); execnotify(globalnotify);
}
if (Blink_Mode == 0) { if (Blink_Mode == 0) {
for (i = 0; i < num_mailboxes; i++) { for (i = 0; i < num_mailboxes; i++) {
@ -1170,9 +1155,7 @@ static void do_biff(int argc, const char **argv)
skin_xpm = wmbiff_master_xpm; skin_xpm = wmbiff_master_xpm;
} }
bkg_xpm = (const char **) CreateBackingXPM(wmbiff_mask_width, bkg_xpm = (const char **) CreateBackingXPM(wmbiff_mask_width, wmbiff_mask_height, skin_xpm);
wmbiff_mask_height,
skin_xpm);
createXBMfromXPM(wmbiff_mask_bits, bkg_xpm, createXBMfromXPM(wmbiff_mask_bits, bkg_xpm,
wmbiff_mask_width, wmbiff_mask_height); wmbiff_mask_width, wmbiff_mask_height);
@ -1190,11 +1173,6 @@ static void do_biff(int argc, const char **argv)
DMA(DEBUG_ERROR, "unable to load font. exiting.\n"); DMA(DEBUG_ERROR, "unable to load font. exiting.\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
/* make the whole background black */
// removed; seems unnecessary with CreateBackingXPM
// eraseRect(x_origin, y_origin,
// wmbiff_mask_width - 6, wmbiff_mask_height - 6,
// background);
} }
/* First time setup of button regions and labels */ /* First time setup of button regions and labels */
@ -1209,12 +1187,9 @@ static void do_biff(int argc, const char **argv)
} }
do { do {
/* waitpid(0, NULL, WNOHANG); */
Sleep_Interval = periodic_mail_check(); Sleep_Interval = periodic_mail_check();
ProcessPendingEvents(); ProcessPendingEvents();
XSleep(Sleep_Interval); XSleep(Sleep_Interval);
} }
while (forever); /* forever is usually true, while (forever); /* forever is usually true,
@ -1272,8 +1247,7 @@ static void printversion(void)
} }
static void parse_cmd(int argc, const char **argv, /*@out@ */ static void parse_cmd(int argc, const char **argv, char *config_file)
char *config_file)
{ {
int i; int i;
@ -1449,12 +1423,3 @@ int main(int argc, const char *argv[])
do_biff(argc, argv); do_biff(argc, argv);
return 0; return 0;
} }
/* vim:set ts=4: */
/*
* Local Variables:
* tab-width: 4
* c-indent-level: 4
* c-basic-offset: 4
* End:
*/