summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-07-31 22:54:01 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-07-31 22:54:01 -0700
commitce4e11143f982234be1076e384b31228f1cc84ae (patch)
treeaf718100e164c7f87ea7412d453aedf33162b591
parent8a3d3a58350506a99efd24f9856466a99bbb9c51 (diff)
Make more functions static that aren't called from other files
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/events.c3
-rw-r--r--src/events.h1
-rw-r--r--src/gram.y7
-rw-r--r--src/iconmgr.c6
-rw-r--r--src/iconmgr.h2
-rw-r--r--src/icons.c4
-rw-r--r--src/icons.h3
-rw-r--r--src/lex.l2
-rw-r--r--src/menus.c32
-rw-r--r--src/menus.h11
-rw-r--r--src/parse.c5
-rw-r--r--src/parse.h2
-rw-r--r--src/resize.c4
-rw-r--r--src/resize.h1
-rw-r--r--src/twm.c4
-rw-r--r--src/twm.h4
16 files changed, 44 insertions, 47 deletions
diff --git a/src/events.c b/src/events.c
index b900516..5b661f6 100644
--- a/src/events.c
+++ b/src/events.c
@@ -109,6 +109,7 @@ static Bool HENQueueScanner ( Display *dpy, XEvent *ev, char *args );
static Bool HLNQueueScanner ( Display *dpy, XEvent *ev, char *args );
static void flush_expose ( Window w );
static Bool UninstallRootColormapQScanner ( Display *dpy, XEvent *ev, char *args );
+static void RedoIconName ( void );
int ButtonPressed = -1;
int Cancel = FALSE;
@@ -942,7 +943,7 @@ HandlePropertyNotify(void)
/**
* procedure to re-position the icon window and name
*/
-void
+static void
RedoIconName(void)
{
int x, y;
diff --git a/src/events.h b/src/events.h
index 3ed340b..e6bcfc9 100644
--- a/src/events.h
+++ b/src/events.h
@@ -82,7 +82,6 @@ extern void HandleVisibilityNotify ( void );
extern void HandleKeyPress ( void );
extern void free_cwins ( TwmWindow *tmp );
extern void HandlePropertyNotify ( void );
-extern void RedoIconName ( void );
extern void HandleClientMessage ( void );
extern void HandleExpose ( void );
extern void HandleDestroyNotify ( void );
diff --git a/src/gram.y b/src/gram.y
index 728297d..241405f 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -89,6 +89,7 @@ static void GotTitleButton ( char *bitmapname, int func, Bool rightside );
static Bool CheckWarpScreenArg ( char *s );
static Bool CheckWarpRingArg ( char *s );
static Bool CheckColormapArg ( char *s );
+static void RemoveDQuote ( char *str );
static char *ptr;
static name_list **list;
@@ -98,6 +99,8 @@ int mods = 0;
unsigned int mods_used = (ShiftMask | ControlMask | Mod1Mask);
extern int yylineno;
+static void yyerror ( const char *s );
+
%}
%union
@@ -659,7 +662,7 @@ number : NUMBER { $$ = $1; }
;
%%
-void
+static void
yyerror(const char *s)
{
twmrc_error_prefix();
@@ -667,7 +670,7 @@ yyerror(const char *s)
ParseError = 1;
}
-void
+static void
RemoveDQuote(char *str)
{
register char *i, *o;
diff --git a/src/iconmgr.c b/src/iconmgr.c
index 29c3c16..78e88b3 100644
--- a/src/iconmgr.c
+++ b/src/iconmgr.c
@@ -42,6 +42,8 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xos.h>
#include <X11/Xmu/CharSet.h>
+static void InsertInIconManager ( IconMgr *ip, WList *tmp, TwmWindow *tmp_win );
+
int iconmgr_textx = siconify_width+11;
static WList *Active = NULL;
WList *DownIconManager = NULL;
@@ -451,7 +453,7 @@ WList *AddIconManager(TwmWindow *tmp_win)
* \param ip the icon manager pointer
* \param tmp the entry to insert
*/
-void InsertInIconManager(IconMgr *ip, WList *tmp, TwmWindow *tmp_win)
+static void InsertInIconManager(IconMgr *ip, WList *tmp, TwmWindow *tmp_win)
{
WList *tmp1;
int added;
@@ -493,7 +495,7 @@ void InsertInIconManager(IconMgr *ip, WList *tmp, TwmWindow *tmp_win)
}
}
-void RemoveFromIconManager(IconMgr *ip, WList *tmp)
+static void RemoveFromIconManager(IconMgr *ip, WList *tmp)
{
if (tmp->prev == NULL)
ip->first = tmp->next;
diff --git a/src/iconmgr.h b/src/iconmgr.h
index 400c44e..8d7c66f 100644
--- a/src/iconmgr.h
+++ b/src/iconmgr.h
@@ -79,12 +79,10 @@ extern WList *AddIconManager ( TwmWindow *tmp_win );
extern IconMgr *AllocateIconManager ( char *name, char *icon_name, char *geom, int columns );
extern void CreateIconManagers ( void );
extern void DrawIconManagerBorder ( WList *tmp );
-extern void InsertInIconManager ( IconMgr *ip, WList *tmp, TwmWindow *tmp_win );
extern void JumpIconManager ( int dir );
extern void MoveIconManager ( int dir );
extern void NotActiveIconManager ( WList *active );
extern void PackIconManager ( IconMgr *ip );
-extern void RemoveFromIconManager ( IconMgr *ip, WList *tmp );
extern void RemoveIconManager ( TwmWindow *tmp_win );
extern void SortIconManager ( IconMgr *ip );
diff --git a/src/icons.c b/src/icons.c
index d03f918..76b8a68 100644
--- a/src/icons.c
+++ b/src/icons.c
@@ -98,13 +98,13 @@ splitEntry (IconEntry *ie, int grav1, int grav2, int w, int h)
}
}
-int
+static inline int
roundUp (int v, int multiple)
{
return ((v + multiple - 1) / multiple) * multiple;
}
-void
+static void
PlaceIcon(TwmWindow *tmp_win, int def_x, int def_y, int *final_x, int *final_y)
{
IconRegion *ir;
diff --git a/src/icons.h b/src/icons.h
index 6767459..f05e8ff 100644
--- a/src/icons.h
+++ b/src/icons.h
@@ -51,9 +51,6 @@ typedef struct IconEntry
short used;
}IconEntry;
-extern int roundUp ( int v, int multiple );
-extern void PlaceIcon ( TwmWindow *tmp_win, int def_x, int def_y,
- int *final_x, int *final_y );
extern void IconUp ( TwmWindow *tmp_win );
extern void IconDown ( TwmWindow *tmp_win );
extern void AddIconRegion ( char *geom, int grav1, int grav2,
diff --git a/src/lex.l b/src/lex.l
index 6f0f627..f880673 100644
--- a/src/lex.l
+++ b/src/lex.l
@@ -72,7 +72,7 @@ int yylineno;
#undef YY_INPUT
#define YY_INPUT(buf,result,size) ((result) = doinput((buf),(size)))
-int doinput (char *buf, int size)
+static int doinput (char *buf, int size)
{
int c;
diff --git a/src/menus.c b/src/menus.c
index 06b345b..1296025 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -114,6 +114,16 @@ static Cursor LastCursor;
static Bool belongs_to_twm_window ( TwmWindow *t, Window w );
static void Identify ( TwmWindow *t );
static void send_clientmessage ( Window w, Atom a, Time timestamp );
+static void BumpWindowColormap ( TwmWindow *tmp, int inc );
+static int DeferExecution ( int context, int func, Cursor cursor );
+static Bool NeedToDefer ( MenuRoot *root );
+static void DestroyMenu ( MenuRoot *menu );
+static void MakeMenu ( MenuRoot *mr );
+static void Execute ( const char *s );
+static void HideIconManager ( void );
+static void WarpAlongRing ( XButtonEvent *ev, Bool forward );
+static int WarpThere ( TwmWindow * t );
+static void WarpToWindow ( TwmWindow *t );
#define SHADOWWIDTH 5 /* in pixels */
@@ -755,7 +765,7 @@ MakeMenus(void)
}
-void
+static void
MakeMenu(MenuRoot *mr)
{
MenuItem *start, *end, *cur, *tmp;
@@ -1157,7 +1167,7 @@ belongs_to_twm_window (TwmWindow *t, Window w)
-void
+static void
resizeFromCenter(Window w, TwmWindow *tmp_win)
{
int lastx, lasty, bw2;
@@ -1265,7 +1275,7 @@ resizeFromCenter(Window w, TwmWindow *tmp_win)
* else FALSE to abort
*/
-int
+static int
WarpThere(TwmWindow *t)
{
if (Scr->WarpUnmapped || t->mapped) {
@@ -2250,7 +2260,7 @@ ExecuteFunction(int func, const char *action, Window w, TwmWindow *tmp_win,
* \param func the function to defer
* \param cursor cursor the cursor to display while waiting
*/
-int
+static int
DeferExecution(int context, int func, Cursor cursor)
{
if (context == C_ROOT)
@@ -2291,7 +2301,7 @@ ReGrab(void)
*
* \param root the menu root to check
*/
-Bool
+static Bool
NeedToDefer(MenuRoot *root)
{
MenuItem *mitem;
@@ -2350,7 +2360,7 @@ System (const char *s)
#endif
-void
+static void
Execute(const char *s)
{
/* FIXME: is all this stuff needed? There could be security problems here. */
@@ -2739,7 +2749,7 @@ WarpToScreen (int n, int inc)
/**
* rotate our internal copy of WM_COLORMAP_WINDOWS
*/
-void
+static void
BumpWindowColormap (TwmWindow *tmp, int inc)
{
int i, j, previously_installed;
@@ -2783,7 +2793,7 @@ BumpWindowColormap (TwmWindow *tmp, int inc)
}
-void
+static void
HideIconManager (void)
{
SetMapStateProp (Scr->iconmgr.twm_win, WithdrawnState);
@@ -2813,7 +2823,7 @@ SetBorder (TwmWindow *tmp, Bool onoroff)
}
-void
+static void
DestroyMenu (MenuRoot *menu)
{
MenuItem *item;
@@ -2838,7 +2848,7 @@ DestroyMenu (MenuRoot *menu)
* warping routines
*/
-void
+static void
WarpAlongRing (XButtonEvent *ev, Bool forward)
{
TwmWindow *r, *head;
@@ -2888,7 +2898,7 @@ WarpAlongRing (XButtonEvent *ev, Bool forward)
-void
+static void
WarpToWindow (TwmWindow *t)
{
int x, y;
diff --git a/src/menus.h b/src/menus.h
index 7314c89..cadffaf 100644
--- a/src/menus.h
+++ b/src/menus.h
@@ -174,28 +174,17 @@ extern void UpdateMenu ( void );
extern MenuRoot * NewMenuRoot ( const char *name );
extern MenuItem * AddToMenu ( MenuRoot *menu, const char *item, const char *action, MenuRoot *sub, int func, const char *fore, const char *back );
extern void MakeMenus ( void );
-extern void MakeMenu ( MenuRoot *mr );
extern Bool PopUpMenu ( MenuRoot *menu, int x, int y, Bool center );
extern void PopDownMenu ( void );
extern MenuRoot * FindMenuRoot ( const char *name );
-extern void resizeFromCenter ( Window w, TwmWindow *tmp_win );
-extern int WarpThere ( TwmWindow * t );
extern int ExecuteFunction ( int func, const char *action, Window w, TwmWindow *tmp_win, XEvent *eventp, int context, int pulldown );
-extern int DeferExecution ( int context, int func, Cursor cursor );
extern void ReGrab ( void );
-extern Bool NeedToDefer ( MenuRoot *root );
-extern void Execute ( const char *s );
extern void FocusOnRoot ( void );
extern void DeIconify ( TwmWindow *tmp_win );
extern void Iconify ( TwmWindow *tmp_win, int def_x, int def_y );
extern void SetMapStateProp ( TwmWindow *tmp_win, int state );
extern void WarpToScreen ( int n, int inc );
-extern void BumpWindowColormap ( TwmWindow *tmp, int inc );
-extern void HideIconManager ( void );
extern void SetBorder ( TwmWindow *tmp, Bool onoroff );
-extern void DestroyMenu ( MenuRoot *menu );
-extern void WarpAlongRing ( XButtonEvent *ev, Bool forward );
-extern void WarpToWindow ( TwmWindow *t );
extern void SendDeleteWindowMessage ( TwmWindow *tmp, Time timestamp );
extern void SendSaveYourselfMessage ( TwmWindow *tmp, Time timestamp );
extern void SendTakeFocusMessage ( TwmWindow *tmp, Time timestamp );
diff --git a/src/parse.c b/src/parse.c
index eb52c62..53cca49 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -87,6 +87,7 @@ static int doparse ( int (*ifunc)(void), const char *srctypename, const char *sr
static int twmFileInput ( void );
static int twmStringListInput ( void );
static int ParseUsePPosition ( char *s );
+static int ParseStringList ( unsigned char **sl );
extern int yylineno;
@@ -222,7 +223,7 @@ int ParseTwmrc (char *filename)
}
}
-int ParseStringList (unsigned char **sl)
+static int ParseStringList (unsigned char **sl)
{
stringListSource = sl;
currentString = *sl;
@@ -943,7 +944,7 @@ int do_color_keyword (int keyword, int colormode, char *s)
/**
* Save a pixel value in twm root window color property.
*/
-void
+static void
put_pixel_on_root(Pixel pixel)
{
int i, addPixel = 1;
diff --git a/src/parse.h b/src/parse.h
index 977a3e9..e461e19 100644
--- a/src/parse.h
+++ b/src/parse.h
@@ -70,10 +70,8 @@ extern int do_number_keyword ( int keyword, int num );
extern name_list **do_colorlist_keyword ( int keyword, int colormode,
char *s );
extern int do_color_keyword ( int keyword, int colormode, char *s );
-void put_pixel_on_root ( Pixel pixel );
extern void do_string_savecolor ( int colormode, char *s );
extern void do_var_savecolor ( int key );
-extern int ParseStringList ( unsigned char **sl );
extern int ParseTwmrc ( char *filename );
extern int parse_keyword ( char *s, int *nump );
extern void TwmOutput ( int c );
diff --git a/src/resize.c b/src/resize.c
index 871be89..7cb4aa6 100644
--- a/src/resize.c
+++ b/src/resize.c
@@ -68,6 +68,8 @@ in this Software without prior written authorization from The Open Group.
#include "screen.h"
#include "events.h"
+static void DisplaySize ( TwmWindow *tmp_win, int width, int height );
+
#define MINHEIGHT 0 /* had been 32 */
#define MINWIDTH 0 /* had been 60 */
@@ -473,7 +475,7 @@ DoResize(int x_root, int y_root, TwmWindow *tmp_win)
* \param width the width of the rubber band
* \param height the height of the rubber band
*/
-void
+static void
DisplaySize(TwmWindow *tmp_win, int width, int height)
{
char str[100];
diff --git a/src/resize.h b/src/resize.h
index 0f4b675..e227ed6 100644
--- a/src/resize.h
+++ b/src/resize.h
@@ -64,7 +64,6 @@ in this Software without prior written authorization from The Open Group.
extern void AddEndResize ( TwmWindow *tmp_win );
extern void AddStartResize ( TwmWindow *tmp_win, int x, int y, int w, int h );
extern void ConstrainSize ( TwmWindow *tmp_win, int *widthp, int *heightp );
-extern void DisplaySize ( TwmWindow *tmp_win, int width, int height );
extern void DoResize ( int x_root, int y_root, TwmWindow *tmp_win );
extern void EndResize ( void );
extern void fullzoom ( TwmWindow *tmp_win, int flag );
diff --git a/src/twm.c b/src/twm.c
index 12f8ca1..112bdeb 100644
--- a/src/twm.c
+++ b/src/twm.c
@@ -86,6 +86,8 @@ in this Software without prior written authorization from The Open Group.
#include <X11/extensions/Print.h>
#endif /* XPRINT */
+static void InitVariables ( void );
+
XtAppContext appContext; /* Xt application context */
XtSignalId si;
@@ -682,7 +684,7 @@ main(int argc, char *argv[])
/**
* initialize twm variables
*/
-void
+static void
InitVariables(void)
{
FreeList(&Scr->BorderColorL);
diff --git a/src/twm.h b/src/twm.h
index aa5f16d..8fe2555 100644
--- a/src/twm.h
+++ b/src/twm.h
@@ -341,7 +341,6 @@ typedef struct TWMWinConfigEntry
#include <X11/Xosdefs.h>
#include <stdlib.h>
-extern void InitVariables ( void );
extern void CreateFonts ( void );
extern void RestoreWithdrawnLocation ( TwmWindow *tmp );
extern void Reborder( Time time);
@@ -403,9 +402,6 @@ extern void twmrc_error_prefix ( void );
extern int yyparse ( void );
extern int yylex ( void );
-extern void yyerror ( const char *s );
-extern int doinput ( char *buf, int size );
-extern void RemoveDQuote ( char *str );
extern Atom TwmAtoms[];