rh

Check-in [c924f9b320]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix warnings. Avoid name clash on getdate().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:c924f9b320d4c710b9781a0b52989cbd26a03e41a7f365c606a81253dae997b6
User & Date: ajv-899-334-8894@vsta.org 2016-08-10 21:22:24
Context
2017-04-24
20:26
My private rhrc macros check-in: 7aea832c71 user: vandyswa@gmail.com tags: master, trunk
2016-08-10
21:22
Fix warnings. Avoid name clash on getdate(). check-in: c924f9b320 user: ajv-899-334-8894@vsta.org tags: master, trunk
21:04
Tidy up git output check-in: 32a60f8413 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to getdate.c.

   749    749   		for (i = milzone; i->name; i++)
   750    750   			if (strcmp(i->name, idvar) == 0) return gotit;
   751    751   	}
   752    752   
   753    753   	return(ID);
   754    754   }
   755    755   
   756         -date_info getdate(p, now)
          756  +date_info rhgetdate(p, now)
   757    757   char *p;
   758    758   struct timeb *now;
   759    759   {
   760    760   #define mcheck(f)	if (f>1) err++
   761    761       int gd_parse();
   762    762       time_t monthadd();
   763    763       int err;

Changes to getdate.h.

     1      1   /*
     2      2    * getdate.h
     3      3    *
     4      4    * Written by:	Rick Ohnemus	(rick@sterling.com)
     5      5    *
     6         - * This file contains the structure returned by getdate().
            6  + * This file contains the structure returned by rhgetdate().
     7      7    *
     8      8    * rcsid: $Id: getdate.h,v 1.1 2008/12/27 00:56:03 vandys Exp $
     9      9    */
    10     10   
    11     11   #if !defined(__GETDATE_H__)
    12     12   #define __GETDATE_H__
    13     13   
................................................................................
    27     27       unsigned int	secflag   : 1;
    28     28       unsigned int	monthflag : 1;
    29     29       unsigned int	yearflag  : 1;
    30     30       unsigned int	dayflag   : 1;
    31     31   
    32     32   } date_info;
    33     33   
    34         -extern date_info getdate();
           34  +extern date_info rhgetdate();
    35     35   
    36     36   #endif	/* __GETDATE_H__ */

Changes to resname.c.

    14     14   static char rcsid[] = "$Id: resname.c,v 1.1 2008/12/27 00:56:03 vandys Exp $";
    15     15   #endif
    16     16   
    17     17   #include <stdio.h>
    18     18   #include <stdlib.h>
    19     19   #include <string.h>
    20     20   #include <fcntl.h>
           21  +#include <unistd.h>
    21     22   
    22     23   #include "alloc.h"
    23     24   
    24     25   #if !defined(MAX_PATH_LEN)
    25     26   #  define MAX_PATH_LEN	1024
    26     27   #endif
    27     28   

Changes to rh.h.

     8      8    */
     9      9   
    10     10   #include <stdio.h>
    11     11   #include <stdlib.h>
    12     12   #include <sys/types.h>
    13     13   #include <sys/stat.h>
    14     14   #include <sys/param.h>
    15         -#include <sys/unistd.h>
           15  +#include <unistd.h>
    16     16   
    17     17   
    18     18   #if !defined(FALSE)
    19     19   #  define FALSE	0
    20     20   #endif
    21     21   
    22     22   #if !defined(TRUE)

Changes to rhcmds.c.

    15     15   #if !defined(lint)
    16     16   static char rcsid[] = "$Id: rhcmds.c,v 1.3 2011/12/31 02:41:07 vandys Exp $";
    17     17   #endif
    18     18   
    19     19   #include "rh.h"
    20     20   #include "rhdata.h"
    21     21   #include "sysinfo.h"
           22  +#include "errmsg.h"
    22     23   
    23     24   void c_or(instr_value *v)
    24     25   {
    25     26       Stack[SP - 2] = Stack[SP - 2] || Stack[SP - 1];
    26     27       SP--;
    27     28       return;
    28     29   }

Changes to rhdata.c.

    10     10   #if !defined(lint)
    11     11   static char rcsid[] = "$Id: rhdata.c,v 1.2 2010/04/22 03:03:16 vandys Exp $";
    12     12   #endif
    13     13   
    14     14   #include "rh.h"
    15     15   #include "rhcmds.h"
    16     16   #include "rhgram.h"
           17  +#include "errmsg.h"
    17     18   
    18     19   #if !defined(S_IREAD)
    19     20   #  define S_IREAD	0400
    20     21   #  define S_IWRITE	0200
    21     22   #  define S_IEXEC	0100
    22     23   #endif
    23     24   

Changes to rhdir.c.

   129    129   
   130    130   void printformat(struct stat *buf,
   131    131   		 const char *name,
   132    132   		 int depth)
   133    133   {
   134    134       static char *hex_digits = "0123456789abcdef";
   135    135   
   136         -    unsigned char	c;
   137         -    char *		fp;
   138         -    group_info *	gi;
   139         -    int			i;
   140         -    char *		p;
   141         -    user_info *		ui;
   142         -    
   143         -    
          136  +    const char *cp;
          137  +    unsigned char c;
          138  +    char *fp, *p;
          139  +    group_info *gi;
          140  +    int	i;
          141  +    user_info *ui;
          142  +
   144    143       for (fp = attr.format; *fp != '\0'; fp++) {
   145    144   	if (*fp != '%') {
   146    145   	    if (*fp != '\\') {
   147    146   		(void) putc(*fp, stdout);
   148    147   		continue;
   149    148   	    }
   150    149   	    fp++;
................................................................................
   330    329   	case 'n':	/* full path of file (relative to start point) */
   331    330   	case 's':
   332    331   	    (void) printf("%s", attr.graphic ? graphic(name) : name);
   333    332   	    break;
   334    333   	    
   335    334   	case 'N':	/* base name of file */
   336    335   	case 'S':
   337         -	    if ((p = strrchr(name, '/')) == (char *) NULL)
   338         -		(void) printf(attr.graphic ? graphic(name) : name);
   339         -	    else
   340         -		(void) printf(attr.graphic ? graphic(p + 1) : (p + 1));
          336  +	    cp = strrchr(name, '/');
          337  +	    if (cp == NULL) {
          338  +		cp = name;
          339  +	    }
          340  +	    (void)printf("%s", attr.graphic ? graphic(cp) : cp);
   341    341   	    break;
   342    342   	    
   343    343   	case 'u':	/* numeric user id */
   344    344   	    (void) printf("%8d", buf->st_uid);
   345    345   	    break;
   346    346   	    
   347    347   	case 'U':	/* symbolic user id */

Changes to rhlex.c.

  1098   1098   					  "empty date specification");
  1099   1099   			    }
  1100   1100   			    Line_pos += yyleng;
  1101   1101   			    date_str = SAVESTR(yytext);
  1102   1102   			    date_str[yyleng - 1] = '\0';
  1103   1103   			    remove_escapes(date_str);
  1104   1104   			    rh_lval.di = ALLOCATE(sizeof(date_info));
  1105         -			    *rh_lval.di = getdate(date_str,
         1105  +			    *rh_lval.di = rhgetdate(date_str,
  1106   1106   						  (struct timeb *) NULL);
  1107   1107   			    free(date_str);
  1108   1108   			    if (rh_lval.di->seconds == -1) {
  1109   1109   				rh_error("invalid date specification");
  1110   1110   			    }
  1111   1111   			    BEGIN(INITIAL);
  1112   1112   			    return DATESPEC;