Changeset 27dc170 in mainline for src/debug/print.c


Ignore:
Timestamp:
2005-05-11T17:08:53Z (20 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
93ca46f
Parents:
d34657e
Message:

const qualifier for print functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/debug/print.c

    rd34657e r27dc170  
    4545 *
    4646 */
    47 void print_str(char *str)
     47void print_str(const char *str)
    4848{
    4949        int i = 0;
     
    6666 *
    6767 */
    68 void print_fixed_hex(__native num, int width)
     68void print_fixed_hex(const __native num, const int width)
    6969{
    7070        int i;
     
    8585 *
    8686 */
    87 void print_number(__native num, int base)
    88 {
     87void print_number(const __native num, const int base)
     88{
     89        int val = num;
    8990        char d[sizeof(__native)*8+1];           /* this is good enough even for base == 2 */
    9091        int i = sizeof(__native)*8-1;
    9192   
    9293        do {
    93                 d[i--] = digits[num % base];
    94         } while (num /= base);
     94                d[i--] = digits[val % base];
     95        } while (val /= base);
    9596       
    9697        d[sizeof(__native)*8] = 0;     
     
    133134 *
    134135 */
    135 void printf(char *fmt, ...)
     136void printf(const char *fmt, ...)
    136137{
    137138        int irqpri, i = 0;
Note: See TracChangeset for help on using the changeset viewer.