projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
avoid signed<->unsigned warning
[oweals/busybox.git]
/
libbb
/
dump.c
diff --git
a/libbb/dump.c
b/libbb/dump.c
index 5a43b7c7052b44bb529242aea49dcf0df7931b51..7d923083ad7e94255060e2aa79c2a4ac9788bc2e 100644
(file)
--- a/
libbb/dump.c
+++ b/
libbb/dump.c
@@
-24,6
+24,7
@@
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <ctype.h> /* for isdigit() */
#include "libbb.h"
#include "dump.h"
#include <ctype.h> /* for isdigit() */
#include "libbb.h"
#include "dump.h"
@@
-248,8
+249,8
@@
static void rewrite(FS * fs)
pr->cchar = pr->fmt + (p1 - fmtp);
/* DBU:[dave@cray.com] w/o this, trailing fmt text, space is lost.
pr->cchar = pr->fmt + (p1 - fmtp);
/* DBU:[dave@cray.com] w/o this, trailing fmt text, space is lost.
- * Skip subsequent text and up to the next % sign and tack the
- * additional text onto fmt: eg. if fmt is "%x is a HEX number",
+ * Skip subsequent text and up to the next % sign and tack the
+ * additional text onto fmt: eg. if fmt is "%x is a HEX number",
* we lose the " is a HEX number" part of fmt.
*/
for (p3 = p2; *p3 && *p3 != '%'; p3++);
* we lose the " is a HEX number" part of fmt.
*/
for (p3 = p2; *p3 && *p3 != '%'; p3++);
@@
-311,7
+312,7
@@
static void do_skip(char *fname, int statok)
struct stat sbuf;
if (statok) {
struct stat sbuf;
if (statok) {
- if (fstat(
fileno(stdin)
, &sbuf)) {
+ if (fstat(
STDIN_FILENO
, &sbuf)) {
bb_perror_msg_and_die("%s", fname);
}
if ((!(S_ISCHR(sbuf.st_mode) ||
bb_perror_msg_and_die("%s", fname);
}
if ((!(S_ISCHR(sbuf.st_mode) ||
@@
-498,7
+499,7
@@
static void conv_u(PR * pr, u_char * p)
/* od used nl, not lf */
if (*p <= 0x1f) {
*pr->cchar = 's';
/* od used nl, not lf */
if (*p <= 0x1f) {
*pr->cchar = 's';
- printf(pr->fmt, list
[4 * (int)(*p)]
);
+ printf(pr->fmt, list
+ (4 * (int)*p)
);
} else if (*p == 0x7f) {
*pr->cchar = 's';
printf(pr->fmt, "del");
} else if (*p == 0x7f) {
*pr->cchar = 's';
printf(pr->fmt, "del");
@@
-544,7
+545,7
@@
static void display(void)
/* PRINT; */
switch (pr->flags) {
case F_ADDRESS:
/* PRINT; */
switch (pr->flags) {
case F_ADDRESS:
- printf(pr->fmt, address);
+ printf(pr->fmt,
(unsigned int)
address);
break;
case F_BPAD:
printf(pr->fmt, "");
break;
case F_BPAD:
printf(pr->fmt, "");
@@
-607,17
+608,17
@@
static void display(void)
conv_u(pr, bp);
break;
case F_UINT:{
conv_u(pr, bp);
break;
case F_UINT:{
- u
_
int ival;
- u
_
short sval;
+ u
nsigned
int ival;
+ u
nsigned
short sval;
switch (pr->bcnt) {
case 1:
switch (pr->bcnt) {
case 1:
- printf(pr->fmt, (u
_
int) * bp);
+ printf(pr->fmt, (u
nsigned
int) * bp);
break;
case 2:
bcopy((char *) bp, (char *) &sval,
sizeof(sval));
break;
case 2:
bcopy((char *) bp, (char *) &sval,
sizeof(sval));
- printf(pr->fmt, (u
_
int) sval);
+ printf(pr->fmt, (u
nsigned
int) sval);
break;
case 4:
bcopy((char *) bp, (char *) &ival,
break;
case 4:
bcopy((char *) bp, (char *) &ival,
@@
-650,7
+651,7
@@
static void display(void)
for (pr = endfu->nextpr; pr; pr = pr->nextpr) {
switch (pr->flags) {
case F_ADDRESS:
for (pr = endfu->nextpr; pr; pr = pr->nextpr) {
switch (pr->flags) {
case F_ADDRESS:
- (void) printf(pr->fmt, eaddress);
+ (void) printf(pr->fmt,
(unsigned int)
eaddress);
break;
case F_TEXT:
(void) printf(pr->fmt);
break;
case F_TEXT:
(void) printf(pr->fmt);
@@
-694,7
+695,7
@@
void bb_dump_add(const char *fmt)
/* start new linked list of format units */
/* NOSTRICT */
/* start new linked list of format units */
/* NOSTRICT */
- tfs = (FS *) xcalloc(1,sizeof(FS)); /*DBU:[dave@cray.com] start out NULL */
+ tfs = (FS *) xcalloc(1,sizeof(FS)); /*DBU:[dave@cray.com] start out NULL */
if (!bb_dump_fshead) {
bb_dump_fshead = tfs;
} else {
if (!bb_dump_fshead) {
bb_dump_fshead = tfs;
} else {