- new upstream release, dropped applied patches

This commit is contained in:
Kamil Dudka 2010-02-23 14:21:11 +00:00
parent 66fbb9d1fe
commit d82c87b169
6 changed files with 7 additions and 309 deletions

View File

@ -1 +1 @@
units-1.87.tar.gz
units-1.88.tar.gz

View File

@ -1 +1 @@
8cf47adf29e38a9aa744e8d5246d1bec units-1.87.tar.gz
9b2ee6e7e0e9c62741944cf33fc8a656 units-1.88.tar.gz

View File

@ -1,234 +0,0 @@
diff --git a/parse.y b/parse.y
index 89a05b1..0bdd8a3 100644
--- a/parse.y
+++ b/parse.y
@@ -29,6 +29,8 @@
#include "units.h"
+int yylex();
+void yyerror(char *);
static int err; /* value used by parser to store return values */
@@ -114,7 +116,7 @@ funcunit(struct unittype *theunit, struct function *fun)
if (err)
return err;
} else if (fun->type==ANGLEOUT || fun->type == DIMENSIONLESS) {
- if (err=unit2num(theunit))
+ if ((err=unit2num(theunit)))
return err;
} else
@@ -278,7 +280,7 @@ struct {
"per" , DIVIDE,
0, 0 };
-yylex(YYSTYPE *lvalp, struct commtype *comm)
+int yylex(YYSTYPE *lvalp, struct commtype *comm)
{
int length, count;
struct unittype *output;
@@ -414,7 +416,7 @@ yylex(YYSTYPE *lvalp, struct commtype *comm)
}
-yyerror(char *s){}
+void yyerror(char *s){}
void
freelist(int startunit)
diff --git a/units.c b/units.c
index f5416b0..2cd6765 100644
--- a/units.c
+++ b/units.c
@@ -29,6 +29,7 @@
#ifdef READLINE
# include <readline/readline.h>
+# include <readline/history.h>
# define RVERSTR "with readline"
#else
# define RVERSTR "without readline"
@@ -489,7 +490,7 @@ readunits(char *file, FILE *errfile,
}
if (wronglocale)
continue;
- if (lineptr = strchr(line,COMMENTCHAR))
+ if ((lineptr = strchr(line,COMMENTCHAR)))
*lineptr = 0;
unitname = strtok(line, WHITE);
if (!unitname || !*unitname)
@@ -519,9 +520,9 @@ readunits(char *file, FILE *errfile,
goterr=1;
continue;
}
- if (pfxptr = plookup(unitname)) { /* already there: redefinition */
+ if ((pfxptr = plookup(unitname))) { /* already there: redefinition */
goterr=1;
- if (errfile)
+ if (errfile) {
if (!strcmp(pfxptr->name, unitname))
fprintf(errfile,
"%s: redefinition of prefix '%s-' on line %d of '%s' ignored.\n",
@@ -529,6 +530,7 @@ readunits(char *file, FILE *errfile,
else
fprintf(errfile, "%s: prefix '%s-' on line %d of '%s' is hidden by earlier definition of '%s-'.\n",
progname, unitname, linenum, file, pfxptr->name);
+ }
continue;
}
@@ -948,7 +950,7 @@ lookupunit(char *unit,int prefixok)
struct prefixlist *pfxptr;
struct unitlist *uptr;
- if (uptr = ulookup(unit))
+ if ((uptr = ulookup(unit)))
return uptr->value;
if (strlen(unit)>2 && unit[strlen(unit) - 1] == 's') {
@@ -1278,7 +1280,7 @@ completereduce(struct unittype *unit)
{
int err;
- if (err=reduceunit(unit))
+ if ((err=reduceunit(unit)))
return err;
sortunit(unit);
cancelunit(unit);
@@ -1340,7 +1342,7 @@ unit2num(struct unittype *input)
int err;
initializeunit(&one);
- if (err=completereduce(input))
+ if ((err=completereduce(input)))
return err;
if (compareunits(input,&one,ignore_nothing))
return E_NOTANUMBER;
@@ -1404,13 +1406,13 @@ rootunit(struct unittype *inunit,int n)
int err;
initializeunit(&outunit);
- if (err=completereduce(inunit))
+ if ((err=completereduce(inunit)))
return err;
- if ((n & 1==0) && (inunit->factor<0)) return E_NOTROOT;
+ if (((n & 1)==0) && (inunit->factor<0)) return E_NOTROOT;
outunit.factor = pow(inunit->factor,1.0/(double)n);
- if (err = subunitroot(n, inunit->numerator, outunit.numerator))
+ if ((err = subunitroot(n, inunit->numerator, outunit.numerator)))
return err;
- if (err = subunitroot(n, inunit->denominator, outunit.denominator))
+ if ((err = subunitroot(n, inunit->denominator, outunit.denominator)))
return err;
freeunit(inunit);
initializeunit(inunit);
@@ -1482,9 +1484,9 @@ addunit(struct unittype *unita, struct unittype *unitb)
{
int err;
- if (err=completereduce(unita))
+ if ((err=completereduce(unita)))
return err;
- if (err=completereduce(unitb))
+ if ((err=completereduce(unitb)))
return err;
if (compareunits(unita,unitb,ignore_nothing))
return E_BADSUM;
@@ -1723,7 +1725,7 @@ showanswer(char *havestr,struct unittype *have,
{
struct unittype invhave;
int doingrec; /* reciprocal conversion? */
- char *sep, *right, *left;
+ char *sep = NULL, *right = NULL, *left = NULL;
doingrec=0;
havestr = removepadding(havestr);
@@ -1970,7 +1972,8 @@ addtolist(struct unittype *have, char *searchstring, char *rname, char *name, ch
int *count, int searchtype)
{
struct unittype want;
- int len,keepit;
+ int len = 0;
+ int keepit = 0;
if (!name)
return;
@@ -2243,7 +2246,7 @@ completeunits(char *text, int state)
curunit = utab[uhash];
}
if (!curunit && !curprefix){
- if (curprefix = plookup(text)){
+ if ((curprefix = plookup(text))){
if (strlen(curprefix->name)>1 && strlen(curprefix->name)<strlen(text)){
uhash = 0;
curunit = utab[uhash];
@@ -2481,7 +2484,7 @@ processunit(struct unittype *theunit, char *unitstr, char *prompt, int pointer)
char *errmsg;
int errloc,err;
- if (err=parseunit(theunit, unitstr, &errmsg, &errloc)){
+ if ((err=parseunit(theunit, unitstr, &errmsg, &errloc))){
if (pointer){
if (err!=E_UNKNOWNUNIT || !irreducible){
if (!quiet) {
@@ -2501,7 +2504,7 @@ processunit(struct unittype *theunit, char *unitstr, char *prompt, int pointer)
return 1;
}
- if (err=completereduce(theunit)){
+ if ((err=completereduce(theunit))){
printf("%s",errormsg[err]);
if (err==E_UNKNOWNUNIT)
printf(" '%s'", irreducible);
@@ -2584,11 +2587,11 @@ Typing 'search text' will show units whose names contain 'text'.\n\n",
UNITMATCH);
return 1;
}
- if (function = isfunction(str)){
+ if ((function = isfunction(str))){
file = function->file;
unitline = function->linenumber;
}
- else if (unit = ulookup(str)){
+ else if ((unit = ulookup(str))){
unitline = unit->linenumber;
file = unit->file;
}
@@ -2678,7 +2681,7 @@ main(int argc, char **argv)
}
if (!interactive) {
- if (funcval = isfunction(havestr)){
+ if ((funcval = isfunction(havestr))){
showfuncdefinition(funcval);
exit(0);
}
@@ -2688,7 +2691,7 @@ main(int argc, char **argv)
showdefinition(havestr,&have);
exit(0);
}
- if (funcval = isfunction(wantstr)){
+ if ((funcval = isfunction(wantstr))){
if (showfunc(havestr, &have, funcval))
exit(1);
else
@@ -2710,7 +2713,7 @@ main(int argc, char **argv)
} while (isblankstr(havestr) || ishelpquery(havestr,0) ||
(isfunction(havestr)==0
&& processunit(&have, havestr, queryhave, POINT)));
- if (funcval = isfunction(havestr)){
+ if ((funcval = isfunction(havestr))){
showfuncdefinition(funcval);
continue;
}
@@ -2728,7 +2731,7 @@ main(int argc, char **argv)
&& processunit(&want, wantstr, querywant, POINT));
if (isblankstr(wantstr))
showdefinition(havestr,&have);
- else if (funcval = isfunction(wantstr))
+ else if ((funcval = isfunction(wantstr)))
showfunc(havestr, &have, funcval);
else {
showanswer(havestr,&have,wantstr, &want);

View File

@ -1,67 +0,0 @@
diff --git a/parse.y b/parse.y
index 0bdd8a3..3d2c8c2 100644
--- a/parse.y
+++ b/parse.y
@@ -247,38 +247,38 @@ double strtod();
struct function
- realfunctions[] = { "sin", sin, ANGLEIN,
- "cos", cos, ANGLEIN,
- "tan", tan, ANGLEIN,
- "ln", log, DIMENSIONLESS,
- "log", log10, DIMENSIONLESS,
- "log2", logb2, DIMENSIONLESS,
- "exp", exp, DIMENSIONLESS,
- "acos", acos, ANGLEOUT,
- "atan", atan, ANGLEOUT,
- "asin", asin, ANGLEOUT,
- 0, 0, 0};
+ realfunctions[] = { {"sin", sin, ANGLEIN},
+ {"cos", cos, ANGLEIN},
+ {"tan", tan, ANGLEIN},
+ {"ln", log, DIMENSIONLESS},
+ {"log", log10, DIMENSIONLESS},
+ {"log2", logb2, DIMENSIONLESS},
+ {"exp", exp, DIMENSIONLESS},
+ {"acos", acos, ANGLEOUT},
+ {"atan", atan, ANGLEOUT},
+ {"asin", asin, ANGLEOUT},
+ {0, 0, 0}};
struct {
char op;
int value;
-} optable[] = { '*', MULTIPLY,
- '/', DIVIDE,
- '|', NUMDIV,
- '+', ADD,
- '(', '(',
- ')', ')',
- '^', EXPONENT,
- '~', FUNCINV,
- 0, 0 };
+} optable[] = { {'*', MULTIPLY},
+ {'/', DIVIDE},
+ {'|', NUMDIV},
+ {'+', ADD},
+ {'(', '('},
+ {')', ')'},
+ {'^', EXPONENT},
+ {'~', FUNCINV},
+ {0, 0}};
struct {
char *name;
int value;
-} strtable[] = { "sqrt", SQRT,
- "cuberoot", CUBEROOT,
- "per" , DIVIDE,
- 0, 0 };
+} strtable[] = { {"sqrt", SQRT},
+ {"cuberoot", CUBEROOT},
+ {"per" , DIVIDE},
+ {0, 0}};
int yylex(YYSTYPE *lvalp, struct commtype *comm)
{

BIN
units-1.88.tar.gz.sig Normal file

Binary file not shown.

View File

@ -1,10 +1,8 @@
Summary: A utility for converting amounts from one unit to another
Name: units
Version: 1.87
Release: 7%{?dist}
Version: 1.88
Release: 1%{?dist}
Source: ftp://ftp.gnu.org/gnu/units/%{name}-%{version}.tar.gz
Patch1: units-1.87-gcc-warnings-1.patch
Patch2: units-1.87-gcc-warnings-2.patch
URL: http://www.gnu.org/software/units/units.html
License: GPLv3+
Group: Applications/Engineering
@ -23,8 +21,6 @@ well as conversions such as Fahrenheit to Celsius.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%build
%configure
@ -59,6 +55,9 @@ fi
%{_mandir}/man1/*
%changelog
* Tue Feb 23 2010 Kamil Dudka <kdudka@redhat.com> - 1.88-1
- new upstream release, dropped applied patches
* Tue Dec 01 2009 Kamil Dudka <kdudka@redhat.com> - 1.87-7
- add BuildRequires for bison