diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-11-23 05:48:34 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@his.com> | 2019-11-23 10:54:00 +0000 |
commit | f973b774e8b1732afbe5a41543a2c7d556845c5d (patch) | |
tree | a8ca8e8c68bcd19b7ff62fca1409fdb5be55c287 /src/cursor.c | |
parent | e2a533d16e047af1c5db19aa9340414b33061d2d (diff) |
Formatted most of the C files using "twm-indent", part of cindent at
https://invisible-island.net/cindent/
That is essentially a script which adds typedefs to the x-indent.sh script.
No object-code changed in this reformatting.
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/cursor.c')
-rw-r--r-- | src/cursor.c | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/src/cursor.c b/src/cursor.c index 9a0cb28..98a1256 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -37,6 +37,7 @@ in this Software without prior written authorization from The Open Group. #include "screen.h" #include "util.h" +/* *INDENT-OFF* */ static struct _CursorName { const char *name; unsigned int shape; @@ -121,25 +122,26 @@ static struct _CursorName { {"watch", XC_watch, None}, {"xterm", XC_xterm, None}, }; +/* *INDENT-ON* */ void -NewFontCursor (Cursor *cp, const char *str) +NewFontCursor(Cursor *cp, const char *str) { int i; - for (i = 0; (size_t)i < sizeof(cursor_names)/sizeof(struct _CursorName); i++) - { - if (strcmp(str, cursor_names[i].name) == 0) - { - if (cursor_names[i].cursor == None) - cursor_names[i].cursor = XCreateFontCursor(dpy, - cursor_names[i].shape); - *cp = cursor_names[i].cursor; - return; - } + for (i = 0; (size_t) i < sizeof(cursor_names) / sizeof(struct _CursorName); + i++) { + if (strcmp(str, cursor_names[i].name) == 0) { + if (cursor_names[i].cursor == None) + cursor_names[i].cursor = XCreateFontCursor(dpy, + cursor_names[i]. + shape); + *cp = cursor_names[i].cursor; + return; + } } - fprintf (stderr, "%s: unable to find font cursor \"%s\"\n", - ProgramName, str); + fprintf(stderr, "%s: unable to find font cursor \"%s\"\n", + ProgramName, str); } void @@ -151,22 +153,23 @@ NewBitmapCursor(Cursor *cp, char *source, char *mask) Pixmap spm, mpm; spm = GetBitmap(source); - if ((hotx = HotX) < 0) hotx = 0; - if ((hoty = HotY) < 0) hoty = 0; + if ((hotx = HotX) < 0) + hotx = 0; + if ((hoty = HotY) < 0) + hoty = 0; mpm = GetBitmap(mask); /* make sure they are the same size */ - XGetGeometry(dpy, spm, &JunkRoot, &sx, &sy, &sw, &sh, &JunkBW,&JunkDepth); - XGetGeometry(dpy, mpm, &JunkRoot, &mx, &my, &mw, &mh, &JunkBW,&JunkDepth); - if (sw != mw || sh != mh) - { - fprintf (stderr, - "%s: cursor bitmaps \"%s\" and \"%s\" not the same size\n", - ProgramName, source, mask); - return; + XGetGeometry(dpy, spm, &JunkRoot, &sx, &sy, &sw, &sh, &JunkBW, &JunkDepth); + XGetGeometry(dpy, mpm, &JunkRoot, &mx, &my, &mw, &mh, &JunkBW, &JunkDepth); + if (sw != mw || sh != mh) { + fprintf(stderr, + "%s: cursor bitmaps \"%s\" and \"%s\" not the same size\n", + ProgramName, source, mask); + return; } *cp = XCreatePixmapCursor(dpy, spm, mpm, &Scr->PointerForeground, - &Scr->PointerBackground, - (unsigned)hotx, (unsigned)hoty); + &Scr->PointerBackground, + (unsigned) hotx, (unsigned) hoty); } |