ls(1): Fix amd64 warnings.
authorSascha Wildner <saw@online.de>
Thu, 26 Feb 2009 05:22:48 +0000 (06:22 +0100)
committerSascha Wildner <saw@online.de>
Thu, 26 Feb 2009 05:58:12 +0000 (06:58 +0100)
bin/ls/ls.c
bin/ls/print.c

index bda220b..d6ddc86 100644 (file)
@@ -581,7 +581,7 @@ display(const FTSENT *p, FTSENT *list)
                        strcpy(initmax2, "0");
 
                ninitmax = sscanf(jinitmax,
-                   " %llu : %lli : %u : %i : %i : %i : %llu : %lu ",
+                   " %ju : %jd : %u : %i : %i : %i : %jd : %lu ",
                    &maxinode, &maxblock, &maxnlink, &maxuser,
                    &maxgroup, &maxflags, &maxsize, &maxlen);
                f_notabs = 1;
@@ -735,7 +735,7 @@ display(const FTSENT *p, FTSENT *list)
                                if (f_fsmid) {
                                        np->fsmid = np->data + ulen + glen + flen + 3;
                                        snprintf(np->fsmid, fsmidlen + 1,  
-                                                "%016llx", fsmid);
+                                                "%016jx", (intmax_t)fsmid);
                                }
 #endif
                                cur->fts_pointer = np;
@@ -759,15 +759,15 @@ display(const FTSENT *p, FTSENT *list)
        if (needstats) {
                d.bcfile = bcfile;
                d.btotal = btotal;
-               snprintf(buf, sizeof(buf), "%lli", maxblock);
+               snprintf(buf, sizeof(buf), "%ji", (intmax_t)maxblock);
                d.s_block = strlen(buf);
                d.s_flags = maxflags;
                d.s_group = maxgroup;
-               snprintf(buf, sizeof(buf), "%llu", maxinode);
+               snprintf(buf, sizeof(buf), "%ju", (uintmax_t)maxinode);
                d.s_inode = strlen(buf);
                snprintf(buf, sizeof(buf), "%u", maxnlink);
                d.s_nlink = strlen(buf);
-               snprintf(buf, sizeof(buf), "%llu", maxsize);
+               snprintf(buf, sizeof(buf), "%jd", (intmax_t)maxsize);
                d.s_size = strlen(buf);
                d.s_user = maxuser;
        }
index 9cf424e..c68edb4 100644 (file)
@@ -144,9 +144,9 @@ printlong(const DISPLAY *dp)
                        continue;
                sp = p->fts_statp;
                if (f_inode)
-                       printf("%*llu ", dp->s_inode, (unsigned long long)sp->st_ino);
+                       printf("%*ju ", dp->s_inode, (uintmax_t)sp->st_ino);
                if (f_size)
-                       printf("%*lld ",
+                       printf("%*jd ",
                            dp->s_block, howmany(sp->st_blocks, blocksize));
                strmode(sp->st_mode, buf);
                np = p->fts_pointer;
@@ -161,8 +161,8 @@ printlong(const DISPLAY *dp)
                        printf("%3d, 0x%08x ",
                               major(sp->st_rdev), (u_int)minor(sp->st_rdev));
                else if (dp->bcfile)
-                       printf("%*s%*lld ",
-                           8 - dp->s_size, "", dp->s_size, sp->st_size);
+                       printf("%*s%*jd ",
+                           8 - dp->s_size, "", dp->s_size, (intmax_t)sp->st_size);
                else
                        printsize(dp->s_size, sp->st_size);
                if (f_accesstime)
@@ -324,11 +324,11 @@ printaname(const FTSENT *p, u_long inodefield, u_long sizefield)
        sp = p->fts_statp;
        chcnt = 0;
        if (f_inode) {
-               chcnt += printf("%*llu ", (int)inodefield,
-                               (unsigned long long)sp->st_ino);
+               chcnt += printf("%*ju ", (int)inodefield,
+                               (uintmax_t)sp->st_ino);
        }
        if (f_size)
-               chcnt += printf("%*lld ",
+               chcnt += printf("%*jd ",
                    (int)sizefield, howmany(sp->st_blocks, blocksize));
 #ifdef COLORLS
        if (f_color)
@@ -585,5 +585,5 @@ printsize(size_t width, off_t bytes)
                                HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
                printf("%5s ", buf);
        } else
-               printf("%*lld ", width, bytes);
+               printf("%*jd ", (int)width, (uintmax_t)bytes);
 }