Subversion Repositories HelenOS

Rev

Rev 1888 | Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1888 Rev 2070
Line 265... Line 265...
265
    number_size = size;
265
    number_size = size;
266
 
266
 
267
    /* Collect sum of all prefixes/signs/... to calculate padding and leading zeroes */
267
    /* Collect sum of all prefixes/signs/... to calculate padding and leading zeroes */
268
    if (flags & __PRINTF_FLAG_PREFIX) {
268
    if (flags & __PRINTF_FLAG_PREFIX) {
269
        switch(base) {
269
        switch(base) {
270
            case 2: /* Binary formating is not standard, but usefull */
270
        case 2: /* Binary formating is not standard, but usefull */
271
                size += 2;
271
            size += 2;
272
                break;
272
            break;
273
            case 8:
273
        case 8:
274
                size++;
274
            size++;
275
                break;
275
            break;
276
            case 16:
276
        case 16:
277
                size += 2;
277
            size += 2;
278
                break;
278
            break;
279
        }
279
        }
280
    }
280
    }
281
 
281
 
282
    sgn = 0;
282
    sgn = 0;
283
    if (flags & __PRINTF_FLAG_SIGNED) {
283
    if (flags & __PRINTF_FLAG_SIGNED) {
Line 326... Line 326...
326
   
326
   
327
    /* print prefix */
327
    /* print prefix */
328
   
328
   
329
    if (flags & __PRINTF_FLAG_PREFIX) {
329
    if (flags & __PRINTF_FLAG_PREFIX) {
330
        switch(base) {
330
        switch(base) {
331
            case 2: /* Binary formating is not standard, but usefull */
331
        case 2: /* Binary formating is not standard, but usefull */
-
 
332
            if (printf_putchar('0', ps) == 1)
-
 
333
                counter++;
-
 
334
            if (flags & __PRINTF_FLAG_BIGCHARS) {
332
                if (printf_putchar('0', ps) == 1)
335
                if (printf_putchar('B', ps) == 1)
333
                    counter++;
336
                    counter++;
334
                if (flags & __PRINTF_FLAG_BIGCHARS) {
-
 
335
                    if (printf_putchar('B', ps) == 1)
-
 
336
                        counter++;
-
 
337
                } else {
337
            } else {
338
                    if (printf_putchar('b', ps) == 1)
338
                if (printf_putchar('b', ps) == 1)
339
                        counter++;
-
 
340
                }
-
 
341
                break;
-
 
342
            case 8:
-
 
343
                if (printf_putchar('o', ps) == 1)
-
 
344
                    counter++;
339
                    counter++;
-
 
340
            }
345
                break;
341
            break;
-
 
342
        case 8:
-
 
343
            if (printf_putchar('o', ps) == 1)
-
 
344
                counter++;
-
 
345
            break;
346
            case 16:
346
        case 16:
-
 
347
            if (printf_putchar('0', ps) == 1)
-
 
348
                counter++;
-
 
349
            if (flags & __PRINTF_FLAG_BIGCHARS) {
347
                if (printf_putchar('0', ps) == 1)
350
                if (printf_putchar('X', ps) == 1)
348
                    counter++;
351
                    counter++;
349
                if (flags & __PRINTF_FLAG_BIGCHARS) {
-
 
350
                    if (printf_putchar('X', ps) == 1)
-
 
351
                        counter++;
-
 
352
                } else {
352
            } else {
353
                    if (printf_putchar('x', ps) == 1)
353
                if (printf_putchar('x', ps) == 1)
354
                        counter++;
354
                    counter++;
355
                }
355
            }
356
                break;
356
            break;
357
        }
357
        }
358
    }
358
    }
359
 
359
 
360
    /* print leading zeroes */
360
    /* print leading zeroes */
361
    precision -= number_size;
361
    precision -= number_size;