From 7ac04a10da06484968e08be04067e5cb957fdf50 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Wed, 23 May 2012 14:41:52 +0000 Subject: [PATCH] Comentando globais sem uso --- actions.c | 40 ---------------------------------------- ctlrc.h | 4 ++++ globals.h | 56 +++++++++++++++++--------------------------------------- util.c | 3 ++- 4 files changed, 23 insertions(+), 80 deletions(-) diff --git a/actions.c b/actions.c index 84e7f82..08727b3 100644 --- a/actions.c +++ b/actions.c @@ -134,44 +134,4 @@ check_usage(XtActionProc action, Cardinal nargs, Cardinal nargs_min, return -1; } */ -/* - * Wrapper for calling an action internally. - */ - /* -void -action_internal(XtActionProc action, enum iaction cause, const char *parm1, - const char *parm2) -{ - Cardinal count = 0; - String parms[2]; - - // Duplicate the parms, because XtActionProc doesn't grok 'const'. - if (parm1 != CN) { - parms[0] = NewString(parm1); - count++; - if (parm2 != CN) { - parms[1] = NewString(parm2); - count++; - } - } - - ia_cause = cause; - (*action)((Widget) NULL, (XEvent *) NULL, - count ? parms : (String *) NULL, - &count); - - // Free the parm copies. - switch (count) { - case 2: - lib3270_free(parms[1]); - // fall through... - case 1: - lib3270_free(parms[0]); - break; - default: - break; - } -} -*/ - diff --git a/ctlrc.h b/ctlrc.h index df8df2a..058d4be 100644 --- a/ctlrc.h +++ b/ctlrc.h @@ -78,6 +78,8 @@ enum dbcs_state { #define IS_LEFT(d) ((d) == DBCS_LEFT || (d) == DBCS_LEFT_WRAP) #define IS_RIGHT(d) ((d) == DBCS_RIGHT || (d) == DBCS_RIGHT_WRAP) #define IS_DBCS(d) (IS_LEFT(d) || IS_RIGHT(d)) + +/* #define MAKE_LEFT(b) { \ if (((b) % COLS) == ((ROWS * COLS) - 1)) \ ea_buf[(b)].db = DBCS_LEFT_WRAP; \ @@ -90,6 +92,8 @@ enum dbcs_state { else \ ea_buf[(b)].db = DBCS_RIGHT; \ } +*/ + #define SOSI(c) (((c) == EBC_so)? EBC_si: EBC_so) enum dbcs_why { DBCS_FIELD, DBCS_SUBFIELD, DBCS_ATTRIBUTE }; diff --git a/globals.h b/globals.h index 5cc7a6e..43c5011 100644 --- a/globals.h +++ b/globals.h @@ -106,7 +106,6 @@ * Prerequisite #includes. */ #include /* Unix standard I/O library */ -// #include /* Other Unix library functions */ #include /* Unix system calls */ #include /* Character classes */ #include /* String manipulations */ @@ -123,33 +122,11 @@ #undef X3270_MENUS #endif /*]*/ -/* Local process (-e) header files. */ /* -#if defined(X3270_LOCAL_PROCESS) && defined(HAVE_LIBUTIL) - #define LOCAL_PROCESS 1 - #include - - #if defined(HAVE_PTY_H) - #include - #endif - - #if defined(HAVE_LIBUTIL_H) - #include - #endif - - #if defined(HAVE_UTIL_H) - #include - #endif -#endif -*/ - /* Functions we may need to supply. */ #if defined(NEED_STRTOK_R) /*[*/ extern char *strtok_r(char *str, const char *sep, char **last); #endif /*]*/ -/* Stop conflicting with curses' COLS, even if we don't link with it. */ -// #define COLS cCOLS - #define CHECK_SESSION_HANDLE(x) if(!x) x = &h3270; @@ -162,9 +139,10 @@ enum iaction { IA_IDLE }; -LIB3270_INTERNAL int COLS; -LIB3270_INTERNAL int ROWS; -extern H3270 h3270; +// LIB3270_INTERNAL int COLS; +// LIB3270_INTERNAL int ROWS; + +LIB3270_INTERNAL H3270 h3270; #if defined(X3270_DISPLAY) /*[*/ LIB3270_INTERNAL Atom a_3270, a_registry, a_encoding; @@ -232,14 +210,14 @@ LIB3270_INTERNAL Boolean exiting; // LIB3270_INTERNAL int maxROWS; // LIB3270_INTERNAL char *model_name; // LIB3270_INTERNAL int model_num; -LIB3270_INTERNAL Boolean no_login_host; -LIB3270_INTERNAL Boolean non_tn3270e_host; +// LIB3270_INTERNAL Boolean no_login_host; +// LIB3270_INTERNAL Boolean non_tn3270e_host; // LIB3270_INTERNAL int ov_cols, ov_rows; - LIB3270_INTERNAL Boolean passthru_host; -extern const char *programname; -LIB3270_INTERNAL char *qualified_host; -LIB3270_INTERNAL char *reconnect_host; -LIB3270_INTERNAL int screen_depth; +// LIB3270_INTERNAL Boolean passthru_host; +// extern const char *programname; +// LIB3270_INTERNAL char *qualified_host; +// LIB3270_INTERNAL char *reconnect_host; +// LIB3270_INTERNAL int screen_depth; LIB3270_INTERNAL Boolean scroll_initted; //#if defined(HAVE_LIBSSL) /*[*/ @@ -247,13 +225,13 @@ LIB3270_INTERNAL Boolean scroll_initted; //#endif /*]*/ LIB3270_INTERNAL Boolean shifted; -LIB3270_INTERNAL Boolean ssl_host; +// LIB3270_INTERNAL Boolean ssl_host; LIB3270_INTERNAL Boolean *standard_font; -LIB3270_INTERNAL Boolean std_ds_host; -LIB3270_INTERNAL char *termtype; -LIB3270_INTERNAL Widget toplevel; +// LIB3270_INTERNAL Boolean std_ds_host; +// LIB3270_INTERNAL char *termtype; +// LIB3270_INTERNAL Widget toplevel; // LIB3270_INTERNAL Boolean visible_control; -LIB3270_INTERNAL int *xtra_width; +// LIB3270_INTERNAL int *xtra_width; /* #if defined(X3270_DISPLAY) @@ -318,7 +296,7 @@ LIB3270_INTERNAL struct trans_list *trans_list; #define CN ((char *) NULL) #define PN ((XtPointer) NULL) -#define Replace(var, value) { lib3270_free(var); var = (value); } +#define Replace(var, value) { lib3270_free(var); var = (value); }; /* Configuration change masks. */ #define NO_CHANGE 0x0000 /* no change */ diff --git a/util.c b/util.c index bd5e6d6..fbe69d4 100644 --- a/util.c +++ b/util.c @@ -880,10 +880,11 @@ rpf_free(rpf_t *r) r->cur_len = 0; } -LIB3270_EXPORT void lib3270_free(void *p) +LIB3270_EXPORT void * lib3270_free(void *p) { if(p) free(p); + return NULL; } LIB3270_EXPORT void * lib3270_realloc(void *p, int len) -- libgit2 0.21.2