[hackers] [swk] drop useless check in gi_x11. dc_init ensures non-null pointer || pancake

From: <hg_AT_suckless.org>
Date: Sun, 22 Aug 2010 06:09:47 +0000 (UTC)

changeset: 61:4b50cb2a25d7
tag: tip
user: pancake <pancake_AT_nopcode.org>
date: Sun Aug 22 08:06:19 2010 +0200
files: TODO gi_x11.c t/calc.c
description:
drop useless check in gi_x11. dc_init ensures non-null pointer
add support for floating point arithmetics to t/calc

diff -r d96a4c3afebb -r 4b50cb2a25d7 TODO
--- a/TODO Sun Aug 22 07:54:34 2010 +0200
+++ b/TODO Sun Aug 22 08:06:19 2010 +0200
@@ -1,5 +1,6 @@
 TODO
 ====
+ * how to schedule a function to be executed in N ns?
   * Add thresold to detect click and pan
   * implement a top bar to mark selected column
   * support multiline text widget
diff -r d96a4c3afebb -r 4b50cb2a25d7 gi_x11.c
--- a/gi_x11.c Sun Aug 22 07:54:34 2010 +0200
+++ b/gi_x11.c Sun Aug 22 08:06:19 2010 +0200
@@ -50,8 +50,7 @@
         char buf[128];
         if(first) {
                 first = 0;
- if (!(dc = dc_init()))
- return 0;
+ dc = dc_init();
                 for(i=0;i<ColorLast;i++) {
                         sprintf(buf, "#%06x", colors[i]);
                         col[i] = dc_color(dc, buf);
diff -r d96a4c3afebb -r 4b50cb2a25d7 t/calc.c
--- a/t/calc.c Sun Aug 22 07:54:34 2010 +0200
+++ b/t/calc.c Sun Aug 22 08:06:19 2010 +0200
@@ -24,6 +24,7 @@
                         pd = popen(buffer2, "r");
                         fgets(buffer, sizeof(buffer), pd);
                         bufferi = strlen(buffer)-1;
+ buffer[bufferi] = 0;
                         pclose(pd);
                         }
                         break;
@@ -64,6 +65,7 @@
         { .cb=button, .text="*" },
         SWK_BOX_NEWLINE(1),
         { .cb=swk_separator },
+ { .cb=button, .text="." },
         { .cb=button, .text="=" },
         { .cb=NULL }
 };
Received on Sun Aug 22 2010 - 08:09:47 CEST

This archive was generated by hypermail 2.2.0 : Sun Aug 22 2010 - 08:12:03 CEST