[CONTACT]

[ABOUT]

[POLICY]

git clone dmenu dmenu Log gph

Found at: gopher.r-36.net:70/scm/dmenu/commit/596033b7818f5ff126ec6c62c375afc4c1e32dda.gph

ts/unsigned int/uint/, s/unsigned long/ulong/ - dmenu - Dmenu fork with xft fonts.

git clone git://r-36.net/dmenu

Log

Files

Refs

README

LICENSE

---

commit 596033b7818f5ff126ec6c62c375afc4c1e32dda

parent 357558798c435f1737b13085b30e2e9e7be3616a

Author: Anselm R Garbe

Date:   Thu, 22 May 2008 11:15:11 +0100
s/unsigned int/uint/, s/unsigned long/ulong/
Diffstat:
  dmenu.c                             |      52 ++++++++++++++++---------------
1 file changed, 27 insertions(+), 25 deletions(-)
---

diff --git a/dmenu.c b/dmenu.c

t@@ -20,10 +20,12 @@
 enum { ColFG, ColBG, ColLast };
 /* typedefs */
+typedef unsigned int uint;
+typedef unsigned long ulong;
 typedef struct {
         int x, y, w, h;
-        unsigned long norm[ColLast];
-        unsigned long sel[ColLast];
+        ulong norm[ColLast];
+        ulong sel[ColLast];
         Drawable drawable;
         GC gc;
         struct {
t@@ -48,11 +50,11 @@ void calcoffsets(void);
 char *cistrstr(const char *s, const char *sub);
 void cleanup(void);
 void drawmenu(void);
-void drawtext(const char *text, unsigned long col[ColLast]);
-void *emalloc(unsigned int size);
+void drawtext(const char *text, ulong col[ColLast]);
+void *emalloc(uint size);
 void eprint(const char *errstr, ...);
 char *estrdup(const char *str);
-unsigned long getcolor(const char *colstr);
+ulong getcolor(const char *colstr);
 Bool grabkeyboard(void);
 void initfont(const char *fontstr);
 void kpress(XKeyEvent * e);
t@@ -60,8 +62,8 @@ void match(char *pattern);
 void readstdin(void);
 void run(void);
 void setup(Bool topbar);
-unsigned int textnw(const char *text, unsigned int len);
-unsigned int textw(const char *text);
+uint textnw(const char *text, uint len);
+uint textw(const char *text);
 #include "config.h"
t@@ -76,10 +78,10 @@ char *selfg = SELFGCOLOR;
 char text[4096];
 int screen;
 int ret = 0;
-unsigned int cmdw = 0;
-unsigned int mw, mh;
-unsigned int promptw = 0;
-unsigned int numlockmask = 0;
+uint cmdw = 0;
+uint mw, mh;
+uint promptw = 0;
+uint numlockmask = 0;
 Bool running = True;
 Display *dpy;
 DC dc = {0};
t@@ -106,7 +108,7 @@ appenditem(Item *i, Item **list, Item **last) {
 void
 calcoffsets(void) {
-        unsigned int tw, w;
+        uint tw, w;
         if(!curr)
                 return;
t@@ -133,7 +135,7 @@ calcoffsets(void) {
 char *
 cistrstr(const char *s, const char *sub) {
         int c, csub;
-        unsigned int len;
+        uint len;
         if(!sub)
                 return (char *)s;
t@@ -215,10 +217,10 @@ drawmenu(void) {
 }
 void
-drawtext(const char *text, unsigned long col[ColLast]) {
+drawtext(const char *text, ulong col[ColLast]) {
         int x, y, w, h;
         static char buf[256];
-        unsigned int len, olen;
+        uint len, olen;
         XRectangle r = { dc.x, dc.y, dc.w, dc.h };
         XSetForeground(dpy, dc.gc, col[ColBG]);
t@@ -255,7 +257,7 @@ drawtext(const char *text, unsigned long col[ColLast]) {
 }
 void *
-emalloc(unsigned int size) {
+emalloc(uint size) {
         void *res = malloc(size);
         if(!res)
t@@ -282,7 +284,7 @@ estrdup(const char *str) {
         return res;
 }
-unsigned long
+ulong
 getcolor(const char *colstr) {
         Colormap cmap = DefaultColormap(dpy, screen);
         XColor color;
t@@ -294,7 +296,7 @@ getcolor(const char *colstr) {
 Bool
 grabkeyboard(void) {
-        unsigned int len;
+        uint len;
         for(len = 1000; len; len--) {
                 if(XGrabKeyboard(dpy, root, True, GrabModeAsync, GrabModeAsync, CurrentTime)
t@@ -350,7 +352,7 @@ void
 kpress(XKeyEvent * e) {
         char buf[32];
         int i, num;
-        unsigned int len;
+        uint len;
         KeySym ksym;
         len = strlen(text);
t@@ -517,7 +519,7 @@ kpress(XKeyEvent * e) {
 void
 match(char *pattern) {
-        unsigned int plen;
+        uint plen;
         Item *i, *itemend, *lexact, *lprefix, *lsubstr, *exactend, *prefixend, *substrend;
         if(!pattern)
t@@ -559,7 +561,7 @@ match(char *pattern) {
 void
 readstdin(void) {
         char *p, buf[1024];
-        unsigned int len = 0, max = 0;
+        uint len = 0, max = 0;
         Item *i, *new;
         i = 0;
t@@ -675,8 +677,8 @@ setup(Bool topbar) {
         XMapRaised(dpy, win);
 }
-unsigned int
-textnw(const char *text, unsigned int len) {
+uint
+textnw(const char *text, uint len) {
         XRectangle r;
         if(dc.font.set) {
t@@ -686,14 +688,14 @@ textnw(const char *text, unsigned int len) {
         return XTextWidth(dc.font.xfont, text, len);
 }
-unsigned int
+uint
 textw(const char *text) {
         return textnw(text, strlen(text)) + dc.font.height;
 }
 int
 main(int argc, char *argv[]) {
-        unsigned int i;
+        uint i;
         Bool topbar = True;
         /* command line args */
.


AD: