bug-gv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gv] [PATCH] avoid shadowing identifiers


From: Bernhard R. Link
Subject: [bug-gv] [PATCH] avoid shadowing identifiers
Date: Sun, 13 Feb 2011 20:18:39 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Shadowing standard library functions is dangerous, as
they might be implemented as macros in some implementation.

Shadowing global variables can show the global variables
have too generic names or are not necessary at all or
hide other problems -Wshadow can hint at, so rename remove
the global, rename the global or rename the local.

Shadowing local variables can lead to suprising results
and hide the other problems -Wshadow can hint at, so rename
them.
---
 gv/src/FileSel.c      |   16 ++++++++--------
 gv/src/Ghostview.c    |   15 +++++----------
 gv/src/actions.c      |   45 ++++++++++++++++++++++-----------------------
 gv/src/callbacks.c    |    3 +--
 gv/src/main.c         |   28 ++++++++++++++--------------
 gv/src/main_globals.h |    2 +-
 gv/src/misc.c         |   31 +++++++++++++++----------------
 gv/src/options_gs.c   |   16 ++++++++--------
 gv/src/ps.c           |   30 +++++++++++++++---------------
 gv/src/zoom.c         |    8 ++++----
 10 files changed, 93 insertions(+), 101 deletions(-)

diff --git a/gv/src/FileSel.c b/gv/src/FileSel.c
index 48c2098..2e7c8f8 100644
--- a/gv/src/FileSel.c
+++ b/gv/src/FileSel.c
@@ -1048,11 +1048,11 @@ static void FS_listAction(w, event, params, nparams)
   else if (streq(params[0],"notify")) {
     INFMESSAGE(notify)
     if (!scrolling) {
-      int entry = VlistEntryOfPosition(list,(int)event->xbutton.y);
-      if (entry >=0 && entry < VlistEntries(list)) {
-       if      (list == FS_CURLIST) 
CurDirSelectionProc(list,NULL,(XtPointer)(intptr_t)entry);
-       else if (list == FS_SUBLIST) 
SubDirSelectionProc(list,NULL,(XtPointer)(intptr_t)entry);
-       else if (list == FS_TOPLIST) 
TopDirSelectionProc(list,NULL,(XtPointer)(intptr_t)entry);
+      int e = VlistEntryOfPosition(list,(int)event->xbutton.y);
+      if (e >=0 && e < VlistEntries(list)) {
+       if      (list == FS_CURLIST) 
CurDirSelectionProc(list,NULL,(XtPointer)(intptr_t)e);
+       else if (list == FS_SUBLIST) 
SubDirSelectionProc(list,NULL,(XtPointer)(intptr_t)e);
+       else if (list == FS_TOPLIST) 
TopDirSelectionProc(list,NULL,(XtPointer)(intptr_t)e);
       }
     }
   }
@@ -1450,13 +1450,13 @@ static void SetDirectoryView(fs,dir)
    INFSMESSAGE(trying to chdir to,dir)
    error=chdir(dir);
    if (error) {
-     char tmpdir[FS_MAXNAMLEN],tmpfile[FS_MAXNAMLEN];
+     char tmpdir[FS_MAXNAMLEN],tempfile[FS_MAXNAMLEN];
      INFMESSAGE(failed)
-     SplitPath(dir,tmpdir,tmpfile);
+     SplitPath(dir,tmpdir,tempfile);
      appendDirEndSeparator(tmpdir);
      INFSMESSAGE(trying to chdir to,tmpdir)
      error=chdir(tmpdir);
-     if (!error) savestrcpy(CURRENT_FILE,tmpfile);
+     if (!error) savestrcpy(CURRENT_FILE,tempfile);
 #ifdef MESSAGES
      else { INFMESSAGE(failed) }
 #endif
diff --git a/gv/src/Ghostview.c b/gv/src/Ghostview.c
index cb5fc56..60af366 100644
--- a/gv/src/Ghostview.c
+++ b/gv/src/Ghostview.c
@@ -1833,11 +1833,11 @@ GhostviewCoordsXtoPS(w,wx,wy,psxP,psyP)
   *psyP = (psly + ((float)y*(float)(psuy-psly))/(float)wly + 0.5);
 #if 1
   {
-    int x,y;
+    int xx,yy;
     IIMESSAGE(wx,wy)
     IIMESSAGE(*psxP,*psyP)
-    GhostviewCoordsPStoX(w,*psxP,*psyP,&x,&y);
-    IIMESSAGE(x,y)
+    GhostviewCoordsPStoX(w,*psxP,*psyP,&xx,&yy);
+    IIMESSAGE(xx,yy)
   }
 #endif
   ENDMESSAGE(GhostviewCoordsXtoPS)
@@ -2131,12 +2131,7 @@ GhostviewIsInterpreterRunning(w)
 
/*###################################################################################*/
 
 Boolean
-GhostviewSendPS(w, fp, begin, len, close)
-    Widget w;
-    FILE *fp;
-    gv_off_t begin;
-    gv_off_t len;
-    Bool close;
+GhostviewSendPS(Widget w, FILE *fp, gv_off_t begin, gv_off_t len, Bool doclose)
 {
     GhostviewWidget gvw = (GhostviewWidget) w;
     struct record_list *ps_new;
@@ -2147,7 +2142,7 @@ GhostviewSendPS(w, fp, begin, len, close)
     ps_new->begin = begin;
     ps_new->len = len;
     ps_new->seek_needed = True;
-    ps_new->close = close;
+    ps_new->close = doclose;
     ps_new->next = NULL;
 
     if (gvw->ghostview.input_buffer == NULL) {
diff --git a/gv/src/actions.c b/gv/src/actions.c
index 38e58fa..44ef394 100644
--- a/gv/src/actions.c
+++ b/gv/src/actions.c
@@ -243,12 +243,12 @@ action_page(w, event, params, num_params)
       a = PAGE_PAGE; e |= PAGE_PAGE;
     }
     else if (!z && !strncmp(s,"highlight",9) && toc_text) {
-      int p,a=0,h,ho;
+      int p,aa=0,h,ho;
       s += 9;
-      if (*s=='=') { s++; a=1; }
+      if (*s=='=') { s++; aa=1; }
       p = atoi(s);
       ho = h = VlistHighlighted(newtoc) + 1;
-      if (!a) {
+      if (!aa) {
        if (h<=0) h =  VlistSelected(newtoc) + 1;
        h = h + p - 1;
       } else {
@@ -387,35 +387,35 @@ action_toc(w, event, params, num_params)
   static int entryo = -1;
   Boolean toggle_mark=False;
   int entry,dy;
-  Widget slider = newtocControl;
-  Widget panner = newtocClip;
+  Widget tocslider = newtocControl;
+  Widget tocpanner = newtocClip;
 
   BEGINMESSAGE(action_toc)
 
   if (!strcmp(params[0],"scroll") && scroll_initialized) {
     int x,y,dh,ph;
-    float dy,m;
-    ph = (int)panner->core.height; if (ph<1) ph = 1;
-    dh = ph - (int)slider->core.height;
-    dy = (float)(event->xbutton.y_root - yo);
-    if (!app_res.reverse_scrolling) dy = -dy;
-    m  = 1.3*((float)slider->core.height/(float)ph);
+    float deltay,m;
+    ph = (int)tocpanner->core.height; if (ph<1) ph = 1;
+    dh = ph - (int)tocslider->core.height;
+    deltay = (float)(event->xbutton.y_root - yo);
+    if (!app_res.reverse_scrolling) deltay = -deltay;
+    m  = 1.3*((float)tocslider->core.height/(float)ph);
     if (m<=1) m = 1;
-    y = yp -(int)(m*dy);
+    y = yp -(int)(m*deltay);
     yo = (int) event->xbutton.y_root;
 
-    ph = (int)panner->core.width; if (ph<1) ph = 1;
-    dh = ph - (int)slider->core.width;
-    dy = (float)(event->xbutton.x_root - xo);
-    if (!app_res.reverse_scrolling) dy = -dy;
-    m  = 1.3*((float)slider->core.width/(float)ph);
+    ph = (int)tocpanner->core.width; if (ph<1) ph = 1;
+    dh = ph - (int)tocslider->core.width;
+    deltay = (float)(event->xbutton.x_root - xo);
+    if (!app_res.reverse_scrolling) deltay = -deltay;
+    m  = 1.3*((float)tocslider->core.width/(float)ph);
     if (m<=1) m = 1;
-    x = xp +(int)(m*dy);
+    x = xp +(int)(m*deltay);
     if (x<dh) x=dh; if (x>0) x=0;
     xo = (int) event->xbutton.x_root;
 
     if (x!=xp) {
-      ClipWidgetSetCoordinates(panner,x,0);
+      ClipWidgetSetCoordinates(tocpanner,x,0);
       xp = x;
     }
     if (y!=yp) {
@@ -427,7 +427,7 @@ action_toc(w, event, params, num_params)
   else if (!strcmp(params[0],"scrollon")) {
     scroll_initialized = True;
     scrolling = False;
-    xp = (int) slider->core.x; xf = xo = (int) event->xbutton.x_root;
+    xp = (int) tocslider->core.x; xf = xo = (int) event->xbutton.x_root;
     yp = 0; yf = yo = (int) event->xbutton.y_root;
     startvisible = VlistGetFirstVisible(newtoc);
   }
@@ -677,17 +677,16 @@ action_panner(w, event, params, num_params)
     int x,y,cw,ch;
     static int xo,yo,xp,yp;
     static Bool initialized=False;
-    Widget panner  = w; 
 
     BEGINMESSAGE(action_panner)
 
     if (!strcmp(params[0],"move") && initialized) {
        INFMESSAGE1(move)
        y = yp + (int)event->xbutton.y_root - yo;
-       ch = (int)panner->core.height-(int)slider->core.height;
+       ch = (int)w->core.height-(int)slider->core.height;
        if (y>ch) y=ch; else if (y<0) y=0;
        x = xp + (int)event->xbutton.x_root - xo;
-       cw = (int)panner->core.width-(int)slider->core.width;
+       cw = (int)w->core.width-(int)slider->core.width;
        if (x>cw) x=cw; else if (x<0) x=0;
        if (x!=xp || y!=yp) {
           int pxp,pyp,dw,dh;
diff --git a/gv/src/callbacks.c b/gv/src/callbacks.c
index 5addd18..f238800 100644
--- a/gv/src/callbacks.c
+++ b/gv/src/callbacks.c
@@ -1032,9 +1032,8 @@ cb_presentation(w, client_data, call_data)
     XtPointer client_data, call_data;
 {
     int pid;
-    typedef void (*sighandler_t)(int);
     sighandler_t sigold;
-    
+
     BEGINMESSAGE(cb_presentation)
 
     sigold = signal(SIGCLD, SIG_IGN); /* Avoid zombies */
diff --git a/gv/src/main.c b/gv/src/main.c
index c7df70f..f109ab8 100644
--- a/gv/src/main.c
+++ b/gv/src/main.c
@@ -923,7 +923,7 @@ int main(argc, argv)
        XtSetArg(args[n], XtNmaximumHeight,maximum_height);n++; 
        XtSetArg(args[n], XtNminimumWidth, (Dimension)app_res.minimum_width); 
n++;
        XtSetArg(args[n], 
XtNminimumHeight,(Dimension)app_res.minimum_height);n++; 
-       control = XtCreateWidget("control",aaaWidgetClass,toplevel,args,n);
+       main_control = XtCreateWidget("control",aaaWidgetClass,toplevel,args,n);
     }
 
 /*### Creating the Menus 
###############################################################*/
@@ -1020,20 +1020,20 @@ int main(argc, argv)
    {
                                                        n=0;
      XtSetArg(args[n], XtNresize, True);               n++;
-     pagemediaButton = 
XtCreateWidget("pagemediaButton",mbuttonWidgetClass,control,args,n);
+     pagemediaButton = 
XtCreateWidget("pagemediaButton",mbuttonWidgetClass,main_control,args,n);
      cont_child[cont_child_num] = pagemediaButton; cont_child_num++;
    }
 
    {
                                                n=0;
      XtSetArg(args[n], XtNresize, False);      n++;
-     processButton = XtCreateWidget("processButton", 
mbuttonWidgetClass,control,args,n);
+     processButton = XtCreateWidget("processButton", 
mbuttonWidgetClass,main_control,args,n);
      cont_child[cont_child_num] = processButton; cont_child_num++;
      processMenu=NULL;
    }
 
                                                        n=0;
-     scaleButton = 
XtCreateWidget("scaleButton",mbuttonWidgetClass,control,args,n);
+     scaleButton = 
XtCreateWidget("scaleButton",mbuttonWidgetClass,main_control,args,n);
      cont_child[cont_child_num] =scaleButton; cont_child_num++;
      main_createScaleMenu();
 
@@ -1084,7 +1084,7 @@ int main(argc, argv)
              INFSMESSAGE(creating widget,b[i].name)
              *(b[i].show) = strstr(layout,b[i].name) ? True : False;
              if (*(b[i].show)) {
-                *(b[i].widget) = 
XtCreateWidget(b[i].name,buttonWidgetClass,control,args,n);
+                *(b[i].widget) = 
XtCreateWidget(b[i].name,buttonWidgetClass,main_control,args,n);
                 if (b[i].callback) 
XtAddCallback(*(b[i].widget),XtNcallback,b[i].callback,b[i].client_data);
                 cont_child[cont_child_num] = *(b[i].widget); cont_child_num++;
              }
@@ -1110,7 +1110,7 @@ int main(argc, argv)
          widgetname=name;                                                      
\
          show = strstr(layout,widgetname) ? True : False;                      
\
          if (show) {                                                           
\
-            widget = 
XtCreateWidget(widgetname,mbuttonWidgetClass,control,args,n);\
+            widget = 
XtCreateWidget(widgetname,mbuttonWidgetClass,main_control,args,n);\
             cont_child[cont_child_num] = widget; cont_child_num++;             
\
          }
 
@@ -1125,7 +1125,7 @@ int main(argc, argv)
           char buf[MAX_LOCATOR_LENGTH];
           sprintf(buf,app_res.locator_format,9999,9999);
           XtSetArg(args[n], XtNlabel,buf);             n++;
-          locator = XtCreateWidget(widgetname,labelWidgetClass,control,args,n);
+          locator = 
XtCreateWidget(widgetname,labelWidgetClass,main_control,args,n);
           cont_child[cont_child_num] =locator; cont_child_num++;
        }
 #      undef _mw_
@@ -1137,7 +1137,7 @@ int main(argc, argv)
        if (show_panner) {
 
                                                                        n=0;
-          pannerFrame = 
XtCreateWidget("pannerFrame",frameWidgetClass,control,args,n);
+          pannerFrame = 
XtCreateWidget("pannerFrame",frameWidgetClass,main_control,args,n);
           cont_child[cont_child_num] = pannerFrame; cont_child_num++;
                                                                        n=0;
           panner = XtCreateManagedWidget("panner", 
compositeWidgetClass,pannerFrame, args, n);
@@ -1155,7 +1155,7 @@ int main(argc, argv)
 
 
                                                                        n=0;
-          newtocFrame = 
XtCreateWidget("newtocFrame",frameWidgetClass,control,args,n);
+          newtocFrame = 
XtCreateWidget("newtocFrame",frameWidgetClass,main_control,args,n);
           cont_child[cont_child_num] = newtocFrame; cont_child_num++;
                                                                        n=0;
           newtocClip = XtCreateManagedWidget("newtocClip", 
clipWidgetClass,newtocFrame, args, n);
@@ -1165,7 +1165,7 @@ int main(argc, argv)
           newtoc = XtCreateManagedWidget("newtoc", 
vlistWidgetClass,newtocControl, args, n);
          XtAddCallback(newtoc, XtNreportCallback,cb_newtocVisibleAdjust, 
(XtPointer)NULL);
                                                                        n=0;
-          newtocScroll = XtCreateWidget("newtocScroll", 
scrollbarWidgetClass,control, args, n);
+          newtocScroll = XtCreateWidget("newtocScroll", 
scrollbarWidgetClass,main_control, args, n);
             XtAddCallback(newtocScroll, XtNscrollProc,cb_newtocScrollbar, 
(XtPointer)1);
              XtAddCallback(newtocScroll, XtNjumpProc,cb_newtocScrollbar, 
(XtPointer)2);
 
@@ -1176,7 +1176,7 @@ int main(argc, argv)
    INFMESSAGE(viewport)
 
                                                                        n=0;
-   viewFrame = XtCreateWidget("viewFrame", frameWidgetClass,control,args,n);
+   viewFrame = XtCreateWidget("viewFrame", 
frameWidgetClass,main_control,args,n);
    cont_child[cont_child_num] = viewFrame; cont_child_num++;
 
                                                                        n=0;
@@ -1286,7 +1286,7 @@ int main(argc, argv)
     INFMESSAGE(managing children of control)
     XtManageChildren((WidgetList)cont_child,cont_child_num);
     INFMESSAGE(managing control)
-    XtManageChild(control);
+    XtManageChild(main_control);
     XtSetMappedWhenManaged(toplevel, False);
     INFMESSAGE(realizing toplevel)
     XtRealizeWidget(toplevel);
@@ -1354,7 +1354,7 @@ int main(argc, argv)
     cb_watchFile(watchFileEntry,NULL,NULL);
 
     /* must allow control to resize */
-    AaaWidgetAllowResize((AaaWidget)control,True,True);
+    AaaWidgetAllowResize((AaaWidget)main_control,True,True);
 
     if (fullscreen_p) {
       Atom net_wm_state;
@@ -1400,7 +1400,7 @@ static void main_createMenu(m,list,numP)
   SMESSAGE(m[0].name)
 
                                                        n=0;
-  *(m[0].widgetP) = 
XtCreateManagedWidget(m[0].name,mbuttonWidgetClass,control,args,n);
+  *(m[0].widgetP) = 
XtCreateManagedWidget(m[0].name,mbuttonWidgetClass,main_control,args,n);
     list[*numP] = *(m[0].widgetP); (*numP)++;
 
                                                        n=0;
diff --git a/gv/src/main_globals.h b/gv/src/main_globals.h
index 4e8f81e..181c214 100644
--- a/gv/src/main_globals.h
+++ b/gv/src/main_globals.h
@@ -172,7 +172,7 @@ EXTERN AppResources                 app_res;
 
 /* Widgets */
 EXTERN Widget   toplevel;
-EXTERN Widget      control;
+EXTERN Widget      main_control;
 EXTERN Widget         titlebutton;
 EXTERN Widget            titlemenu;
 EXTERN Widget         datebutton;
diff --git a/gv/src/misc.c b/gv/src/misc.c
index cd05833..cc7950c 100644
--- a/gv/src/misc.c
+++ b/gv/src/misc.c
@@ -204,25 +204,25 @@ misc_drawEyeGuide(w,d,x,y)
     if (egd->timer) XtRemoveTimeOut(egd->timer);
     egd->timer = 
XtAppAddTimeOut(app_con,t,misc_catchEyeGuideTimer,(XtPointer)egd);
     if (!egd->drawn) {
-      int x1,y1,x2,y2,nx,ny;
+      int x_1,y_1,x_2,y_2,nx,ny;
       Widget clip = XtParent(XtParent(w));
       INFMESSAGE(drawing)
       nx = (int)w->core.x + (int) w->core.border_width;
       ny = (int)w->core.y + (int) w->core.border_width;
-      if (-x>nx) x1 = -x - nx; else x1=0;
-      if (-y>ny) y1 = -y - ny; else y1=0;
-      x2 = x1 + (int)clip->core.width -1; 
-      if (-x<nx) x2 -= nx;
-      if (x2 > w->core.width) x2 = w->core.width;
-      y2 = y1 + (int)clip->core.height - 1;
-      if (-y<ny) y2 -= ny;
-      if (y2 > w->core.height) y2 = w->core.height;
-      if (x1==0) x1 = -1;
-      if (y1==0) y1 = -1;
-      egd->x = x1;
-      egd->y = y1;
-      egd->width = x2-x1;
-      egd->height = y2-y1;
+      if (-x>nx) x_1 = -x - nx; else x_1=0;
+      if (-y>ny) y_1 = -y - ny; else y_1=0;
+      x_2 = x_1 + (int)clip->core.width -1; 
+      if (-x<nx) x_2 -= nx;
+      if (x_2 > w->core.width) x_2 = w->core.width;
+      y_2 = y_1 + (int)clip->core.height - 1;
+      if (-y<ny) y_2 -= ny;
+      if (y_2 > w->core.height) y_2 = w->core.height;
+      if (x_1==0) x_1 = -1;
+      if (y_1==0) y_1 = -1;
+      egd->x = x_1;
+      egd->y = y_1;
+      egd->width = x_2-x_1;
+      egd->height = y_2-y_1;
       GhostviewDrawRectangle(w,egd->x,egd->y,egd->width,egd->height);
       egd->drawn=1;
     }
@@ -1120,7 +1120,6 @@ setup_ghostview()
 
 Dimension view_width, view_height, view_border;
 Dimension control_width, control_height;
-Dimension page_width, page_height;
 
 /*------------------------------------------------------------*/
 /* layout_ghostview */
diff --git a/gv/src/options_gs.c b/gv/src/options_gs.c
index e3fbc4c..499c242 100644
--- a/gv/src/options_gs.c
+++ b/gv/src/options_gs.c
@@ -154,7 +154,7 @@ static void options_gs_cb_apply(w, client_data, call_data)
    Cardinal n;
    int i;
    Boolean reopen=False;
-   String free[6] = {NULL,NULL,NULL,NULL,NULL,NULL};
+   String f[6] = {NULL,NULL,NULL,NULL,NULL,NULL};
 
    BEGINMESSAGE(options_gs_cb_apply)
 
@@ -170,12 +170,12 @@ static void options_gs_cb_apply(w, client_data, call_data)
    gv_gs_safeDir = SwitchIsSet(safeDirToggle) ? 1 : 0;
    if (i != gv_gs_safeDir) reopen=True;
 
-   reopen |= options_gs_change(gs,&gv_gs_interpreter,&(free[0]));
-   reopen |= options_gs_change(scan,&gv_gs_cmd_scan_pdf,&(free[1]));
-            options_gs_change(conv,&gv_gs_cmd_conv_pdf,&(free[2]));
-   reopen |= options_gs_change(x11dev,&gv_gs_x11_device,&(free[3]));
-   reopen |= options_gs_change(x11alphadev,&gv_gs_x11_alpha_device,&(free[4]));
-   reopen |= options_gs_change(arguments,&gv_gs_arguments,&(free[5]));
+   reopen |= options_gs_change(gs,&gv_gs_interpreter,&(f[0]));
+   reopen |= options_gs_change(scan,&gv_gs_cmd_scan_pdf,&(f[1]));
+            options_gs_change(conv,&gv_gs_cmd_conv_pdf,&(f[2]));
+   reopen |= options_gs_change(x11dev,&gv_gs_x11_device,&(f[3]));
+   reopen |= options_gs_change(x11alphadev,&gv_gs_x11_alpha_device,&(f[4]));
+   reopen |= options_gs_change(arguments,&gv_gs_arguments,&(f[5]));
 
    if (reopen) {
      cb_stopInterpreter(page,NULL,NULL);
@@ -194,7 +194,7 @@ static void options_gs_cb_apply(w, client_data, call_data)
      XtSetValues(page, args, n);
      if (gv_filename) show_page(REQUEST_REOPEN,NULL);
    }
-   for (i=0; i<6 ; i++) if (free[i]) GV_XtFree(free[i]);
+   for (i=0; i<6 ; i++) if (f[i]) GV_XtFree(f[i]);
 
    ENDMESSAGE(options_gs_cb_apply)
 }
diff --git a/gv/src/ps.c b/gv/src/ps.c
index 34f6e30..cb9e6e4 100644
--- a/gv/src/ps.c
+++ b/gv/src/ps.c
@@ -409,7 +409,7 @@ 
psscan(fileP,filename,filename_raw,filename_dscP,cmd_scan_pdf,filename_uncP,cmd_
 #ifndef HAVE_ZIO
     if (cmd_uncompress) {
       struct document *retval = NULL;
-      FILE *tmpfile = (FILE*)NULL;
+      FILE *tempfile = (FILE*)NULL;
       char *filename_unc;
       char *quoted_filename, *quoted_filename_unc;
       char cmd[512];
@@ -444,7 +444,7 @@ unc_exec_failed:
 unc_failed:
 #endif
        NotePopupShowMessage(s);
-       if (tmpfile) fclose(tmpfile);
+       if (tempfile) fclose(tempfile);
        unlink(filename_unc);
 unc_ok:
        GV_XtFree(filename_unc);
@@ -452,10 +452,10 @@ unc_ok:
         return(retval);
       }
       umask(old_umask);
-      tmpfile = fopen(filename_unc, "r");
-      if (!tmpfile) goto unc_exec_failed;
+      tempfile = fopen(filename_unc, "r");
+      if (!tempfile) goto unc_exec_failed;
       fclose(*fileP);
-      *fileP = tmpfile;
+      *fileP = tempfile;
       retval = 
psscan(fileP,filename_unc,filename_raw,filename_dscP,cmd_scan_pdf,NULL,NULL,scanstyle,
 gv_gs_safeDir);
 #if 0
       if (!retval) {
@@ -520,7 +520,7 @@ unc_ok:
     } else if (iscomment(line,"%PDF-") && cmd_scan_pdf) {
       
       struct document *retval = NULL;
-      FILE *tmpfile = (FILE*)NULL;
+      FILE *tempfile = (FILE*)NULL;
       char *filename_dsc;
       char *quoted_filename, *quoted_filename_dsc;
       char *pdfpos;
@@ -534,7 +534,7 @@ unc_ok:
       filename_dsc=file_getTmpFilename(NULL, filename_raw, NULL);
       if (!filename_dsc) {
        NotePopupShowMessage("Cannot create temporary file!");
-       if (tmpfile) fclose(tmpfile);
+       if (tempfile) fclose(tempfile);
         ps_io_exit(fd);
        ENDMESSAGE(psscan)
         return(retval);
@@ -597,7 +597,7 @@ unc_ok:
 
 
       if (system(cmd) || file_fileIsNotUseful(filename_dsc)) {
-        char line[1000];
+        char password_line[1000];
        int found;
        FILE* tmp_file;
        
@@ -609,11 +609,11 @@ unc_ok:
        close(tmpfd);
 
         tmp_file = fopen( tmp_filename, "r" );
-       while ( fgets( line, 999, tmp_file) )
+       while ( fgets( password_line, 999, tmp_file) )
        {
-          if (strstr(line,"This file requires a password for access."))
+          if (strstr(password_line,"This file requires a password for 
access."))
              found = 1;
-          if (strstr(line,"Password did not work."))
+          if (strstr(password_line,"Password did not work."))
              found = 1;
         }
        fclose(tmp_file);       
@@ -634,7 +634,7 @@ scan_exec_failed:
 scan_failed:
        NotePopupShowMessage(s);
 scan_password_required:
-       if (tmpfile) fclose(tmpfile);
+       if (tempfile) fclose(tempfile);
        unlink(filename_dsc);
 scan_ok:
        GV_XtFree(filename_dsc);
@@ -652,10 +652,10 @@ scan_ok:
       GV_XtFree(tmp_filename);
 
       umask (old_umask);
-      tmpfile = fopen(filename_dsc, "r");
-      if (!tmpfile) goto scan_exec_failed;
+      tempfile = fopen(filename_dsc, "r");
+      if (!tempfile) goto scan_exec_failed;
       fclose(*fileP);
-      *fileP = tmpfile;
+      *fileP = tempfile;
       retval = 
psscan(fileP,filename_dsc,filename_raw,filename_dscP,cmd_scan_pdf,NULL,NULL,scanstyle,gv_gs_safeDir);
       if (!retval) {
        sprintf(s,"Scanning\n%s\nfailed.",filename_dsc);
diff --git a/gv/src/zoom.c b/gv/src/zoom.c
index 099c53c..ccf6c4c 100644
--- a/gv/src/zoom.c
+++ b/gv/src/zoom.c
@@ -216,14 +216,14 @@ zoom_createZoom(w, call_data)
     widgets_preferButton(zdismiss,1);
 
     {
-      GhostviewReturnStruct p;
+      GhostviewReturnStruct rs;
       INFMESSAGE(positioning zoom popup)
       IIMESSAGE(llx,lly) IIMESSAGE(urx,ury)
-      GhostviewGetAreaOfBB(page,llx,lly,urx,ury,&p);
+      GhostviewGetAreaOfBB(page,llx,lly,urx,ury,&rs);
       popup_positionPopup(
           zshell,page,POPUP_POSITION_POS_CENTER,
-          ((int)(p.psx)+(int)(p.width/2)),
-          ((int)(p.psy)+(int)(p.height/2))
+          ((int)(rs.psx)+(int)(rs.width/2)),
+          ((int)(rs.psy)+(int)(rs.height/2))
       );
     }
     GhostviewSetup(zpage);
-- 
1.5.6.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]