diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/XSpadFill.c | 6 | ||||
-rw-r--r-- | src/lib/fnct_key.c | 7 | ||||
-rw-r--r-- | src/lib/openpty.c | 39 | ||||
-rw-r--r-- | src/lib/pixmap.c | 8 | ||||
-rw-r--r-- | src/lib/sockio-c.c | 5 |
5 files changed, 27 insertions, 38 deletions
diff --git a/src/lib/XSpadFill.c b/src/lib/XSpadFill.c index f4408db9..566c57ce 100644 --- a/src/lib/XSpadFill.c +++ b/src/lib/XSpadFill.c @@ -1,7 +1,7 @@ /* Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. All rights reserved. - Copyright (C) 2007-2010, Gabriel Dos Reis. + Copyright (C) 2007-2013, Gabriel Dos Reis. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -83,7 +83,6 @@ int XInitSpadFill(Display *dsply, int scr, Colormap * mapOfColors, int * hues, int *solid, int * dithered, int * shades) { - int maxDither; XColor BlackColor, WhiteColor; XColor retColor; int maxSolid; @@ -120,7 +119,6 @@ XInitSpadFill(Display *dsply, int scr, Colormap * mapOfColors, int * hues, if (DisplayPlanes(dsply, scr) < 8) { *dithered = totalDithered = maxGreyShade = XInitShades(dsply, scr); - maxDither = *dithered - 1; spadColors = (unsigned long *) malloc(2 * sizeof(unsigned long)); spadColors[0] = BlackColor.pixel; spadColors[1] = WhiteColor.pixel; @@ -137,7 +135,6 @@ XInitSpadFill(Display *dsply, int scr, Colormap * mapOfColors, int * hues, *dithered = totalDithered = XInitDither(dsply, scr, stippleGC, black, white); - maxDither = *dithered - 1; if ((maxSolid = makeColors(dsply, scr, &cmap, &spadColors, &totalSolid)) > 0) { *solid = totalSolid + 2; @@ -152,7 +149,6 @@ XInitSpadFill(Display *dsply, int scr, Colormap * mapOfColors, int * hues, * makeColors managed to fail -- switch to mono */ *dithered = totalDithered = maxGreyShade = XInitShades(dsply, scr); - maxDither = *dithered - 1; spadColors = (unsigned long *) malloc(2 * sizeof(unsigned long)); spadColors[0] = BlackColor.pixel; spadColors[1] = WhiteColor.pixel; diff --git a/src/lib/fnct_key.c b/src/lib/fnct_key.c index 09083999..f70bc430 100644 --- a/src/lib/fnct_key.c +++ b/src/lib/fnct_key.c @@ -1,7 +1,7 @@ /* Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. All rights reserved. - Copyright (C) 2007-2011 Gabriel Dos Reis. + Copyright (C) 2007-2013 Gabriel Dos Reis. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -103,7 +103,6 @@ define_function_keys(void) int key; int fd; char type; - int length; /** lets initialize the key pointers **/ for (key = 0; key < 13; key++) @@ -117,7 +116,7 @@ define_function_keys(void) else { /*** If so, then get the key bindings **/ while ((key = get_key(fd, &type))) { - length = get_str(fd, string); + get_str(fd, string); switch (type) { case 'D': if (key == 12) { @@ -228,7 +227,6 @@ handle_function_key(int key,int chann) int count, fd; int amount = strlen(function_key[key].str); int id; - int save_echo; /*** This procedure takes the character at in_buff[num_proc] and adds it to the buffer. It first checks to see if we should be inserting @@ -335,7 +333,6 @@ handle_function_key(int key,int chann) buff_pntr = curr_pntr = 0; /** reset the ring pointer **/ current = NULL; - save_echo = ECHOIT; ECHOIT = 0; while ((num_read = read(fd, in_buff, MAXLINE))) { do_reading(); diff --git a/src/lib/openpty.c b/src/lib/openpty.c index f737802a..5918aa7a 100644 --- a/src/lib/openpty.c +++ b/src/lib/openpty.c @@ -1,7 +1,7 @@ /* Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. All rights reserved. - Copyright (C) 2007-2009, Gabriel Dos Reis. + Copyright (C) 2007-2013, Gabriel Dos Reis. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -60,7 +60,24 @@ #include "openpty.h" -static void makeNextPtyNames(char * , char * ); +#if defined(SUNplatform) +static void +makeNextPtyNames(char *cont,char * serv) +{ + static int channelNo = 0; + static char group[] = "pqrstuvwxyzPQRST"; + static int groupNo = 0; + + sprintf(cont, "/dev/pty%c%x", group[groupNo], channelNo); + sprintf(serv, "/dev/tty%c%x", group[groupNo], channelNo); + channelNo++; /* try next */ + if (channelNo == 16) { /* move to new group */ + channelNo = 0; + groupNo++; + if (groupNo == 16) groupNo = 0; /* recycle */ + } +} +#endif /* @@ -149,21 +166,3 @@ extern char* ptsname(int); } -static void -makeNextPtyNames(char *cont,char * serv) -{ -#if defined(SUNplatform) - static int channelNo = 0; - static char group[] = "pqrstuvwxyzPQRST"; - static int groupNo = 0; - - sprintf(cont, "/dev/pty%c%x", group[groupNo], channelNo); - sprintf(serv, "/dev/tty%c%x", group[groupNo], channelNo); - channelNo++; /* try next */ - if (channelNo == 16) { /* move to new group */ - channelNo = 0; - groupNo++; - if (groupNo == 16) groupNo = 0; /* recycle */ - } -#endif -} diff --git a/src/lib/pixmap.c b/src/lib/pixmap.c index 2d321743..d0ad2097 100644 --- a/src/lib/pixmap.c +++ b/src/lib/pixmap.c @@ -1,7 +1,7 @@ /* Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. All rights reserved. - Copyright (C) 2007-2011, Gabriel Dos Reis. + Copyright (C) 2007-2013, Gabriel Dos Reis. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -271,7 +271,6 @@ read_pixmap_file(Display *display, int screen, char *filename, { XpmAttributes attr; XImage *xireturn; - int status; attr.valuemask = 0; @@ -289,7 +288,7 @@ read_pixmap_file(Display *display, int screen, char *filename, attr.valuemask |= XpmAllocCloseColors; /* we don't allocate close colors*/ - status=XpmReadFileToImage(display,filename,xi,&xireturn, &attr ); + XpmReadFileToImage(display,filename,xi,&xireturn, &attr ); *width= (*xi)->width; *height=(*xi)->height; #ifdef DEBUG @@ -306,12 +305,11 @@ write_pixmap_file(Display *dsp, int scr, char *fn, Window wid, int x, int y, int width,int height) { XImage *xi; - int status; /* reads image structure in ZPixmap format */ xi = XGetImage(dsp, wid, x, y, width, height, AllPlanes, ZPixmap); if (xi==0) return ; - status=XpmWriteFileFromImage(dsp,fn,xi,0,0); + XpmWriteFileFromImage(dsp,fn,xi,0,0); } diff --git a/src/lib/sockio-c.c b/src/lib/sockio-c.c index 662768f2..d44eb818 100644 --- a/src/lib/sockio-c.c +++ b/src/lib/sockio-c.c @@ -1,7 +1,7 @@ /* Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. All rights reserved. - Copyright (C) 2007-2010, Gabriel Dos Reis. + Copyright (C) 2007-2013, Gabriel Dos Reis. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -846,9 +846,8 @@ sock_send_floats(int purpose, const double *vals, int num) OPENAXIOM_C_EXPORT double get_float(openaxiom_sio *sock) { - int val; double num = -1.0; - val = fill_buf(sock, byte_address(num), sizeof(double), "get_float"); + fill_buf(sock, byte_address(num), sizeof(double), "get_float"); #ifdef DEBUG fprintf(stderr,"get_float: received %f\n",num); #endif |