summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1998-10-08 11:55:37 +0000
committerjbj <devnull@localhost>1998-10-08 11:55:37 +0000
commitd93b2ada1113caba237fd73b04d8eebe45fc5d31 (patch)
tree1044843fc01fdb13ad022c8789d15f369679039d /build
parent7e8efa2f984512efdd92f76c1e13be97c36943a2 (diff)
downloadlibrpm-tizen-d93b2ada1113caba237fd73b04d8eebe45fc5d31.tar.gz
librpm-tizen-d93b2ada1113caba237fd73b04d8eebe45fc5d31.tar.bz2
librpm-tizen-d93b2ada1113caba237fd73b04d8eebe45fc5d31.zip
egcs warning removal.
CVS patchset: 2422 CVS date: 1998/10/08 11:55:37
Diffstat (limited to 'build')
-rw-r--r--build/expression.c21
-rw-r--r--build/files.c7
-rw-r--r--build/parsePrep.c4
3 files changed, 22 insertions, 10 deletions
diff --git a/build/expression.c b/build/expression.c
index 8aefeebb7..2edd4bb21 100644
--- a/build/expression.c
+++ b/build/expression.c
@@ -68,6 +68,7 @@ static void valueFree(Value v)
}
}
+#ifdef DEBUG_PARSER
static void valueDump(Value v, FILE *fp)
{
if (v) {
@@ -78,6 +79,7 @@ static void valueDump(Value v, FILE *fp)
} else
fprintf(fp, "NULL\n");
}
+#endif
#define valueIsInteger(v) ((v)->type == VALUE_TYPE_INTEGER)
#define valueIsString(v) ((v)->type == VALUE_TYPE_STRING)
@@ -325,6 +327,9 @@ static Value doPrimary(ParseState state)
v = valueMakeInteger(! v->data.i);
break;
+ default:
+ return NULL;
+ break;
}
DEBUG(valueDump(v, stdout));
@@ -462,7 +467,7 @@ static Value doRelational(ParseState state)
}
if (valueIsInteger(v1)) {
- int i1 = v1->data.i, i2 = v2->data.i, r;
+ int i1 = v1->data.i, i2 = v2->data.i, r = 0;
switch (op) {
case TOK_EQ:
r = (i1 == i2);
@@ -482,11 +487,13 @@ static Value doRelational(ParseState state)
case TOK_GE:
r = (i1 >= i2);
break;
+ default:
+ break;
}
valueFree(v1);
v1 = valueMakeInteger(r);
} else {
- char *s1 = v1->data.s, *s2 = v2->data.s, r;
+ char *s1 = v1->data.s, *s2 = v2->data.s, r = 0;
switch (op) {
case TOK_EQ:
r = (strcmp(s1,s2) == 0);
@@ -506,6 +513,8 @@ static Value doRelational(ParseState state)
case TOK_GE:
r = (strcmp(s1,s2) >= 0);
break;
+ default:
+ break;
}
valueFree(v1);
v1 = valueMakeInteger(r);
@@ -565,7 +574,7 @@ static Value doLogical(ParseState state)
int parseExpressionBoolean(Spec spec, char *expr)
{
struct _parseState state;
- int result;
+ int result = -1;
Value v;
DEBUG(printf("parseExprBoolean(?, '%s')\n", expr));
@@ -598,6 +607,8 @@ int parseExpressionBoolean(Spec spec, char *expr)
case VALUE_TYPE_STRING:
result = v->data.s[0] != '\0';
break;
+ default:
+ break;
}
free(state.str);
@@ -608,7 +619,7 @@ int parseExpressionBoolean(Spec spec, char *expr)
char * parseExpressionString(Spec spec, char *expr)
{
struct _parseState state;
- char *result;
+ char *result = NULL;
Value v;
DEBUG(printf("parseExprBoolean(?, '%s')\n", expr));
@@ -644,6 +655,8 @@ char * parseExpressionString(Spec spec, char *expr)
case VALUE_TYPE_STRING:
result = strdup(v->data.s);
break;
+ default:
+ break;
}
free(state.str);
diff --git a/build/files.c b/build/files.c
index 951bb5133..1552b7cb4 100644
--- a/build/files.c
+++ b/build/files.c
@@ -586,7 +586,7 @@ VFA_t virtualFileAttributes[] = {
{ "%noreplace", RPMFILE_CONFIG|RPMFILE_NOREPLACE },
#endif
- NULL
+ { NULL, 0 }
};
static int parseForSimple(Spec spec, Package pkg, char *buf,
@@ -594,7 +594,6 @@ static int parseForSimple(Spec spec, Package pkg, char *buf,
{
char *s, *t;
int res, specialDoc = 0;
- char *name, *version;
char specialDocBuf[BUFSIZ];
specialDocBuf[0] = '\0';
@@ -1506,8 +1505,8 @@ static StringBuf getOutputFrom(char *dir, char *argv[],
appendStringBuf(readBuff, buf);
}
- /* terminate on (non-blocking) error or EOF */
- } while (!(bytes < 0 && errno != EAGAIN || bytes == 0));
+ /* terminate on (non-blocking) EOF or error */
+ } while (!(bytes == 0 || (bytes < 0 && errno != EAGAIN)));
/* Clean up */
if (toProg[1] >= 0)
diff --git a/build/parsePrep.c b/build/parsePrep.c
index be00fc39f..8bddc6bfa 100644
--- a/build/parsePrep.c
+++ b/build/parsePrep.c
@@ -114,7 +114,7 @@ static char *doUntar(Spec spec, int c, int quietly)
{
static char buf[BUFSIZ];
char file[BUFSIZ];
- char *s, *taropts;
+ char *taropts;
struct Source *sp;
int compressed;
@@ -132,7 +132,7 @@ static char *doUntar(Spec spec, int c, int quietly)
expandMacros(spec, spec->macros, file, sizeof(file));
strcat(file, sp->source);
- taropts = (rpmIsVerbose() && !quietly ? "-xvvf" : "-xf");
+ taropts = ((rpmIsVerbose() && !quietly) ? "-xvvf" : "-xf");
if (isCompressed(file, &compressed)) {
return NULL;