Changeset 470 for trunk


Ignore:
Timestamp:
Aug 21, 2018, 12:50:49 PM (6 years ago)
Author:
viala@…
Message:

minor: add const to cause parameter in sched_yield.

We never mutate the string parameter.

Gcc warning fixed:
`
hal/tsar_mips32/drivers/soclib_tty.c:183:30:
warning: passing argument 1 of 'sched_yield' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

sched_yield( "TTY_TX_FIFO full" );

~

In file included from kernel/kern/core.h:32,

from kernel/kern/thread.h:35,
from hal/tsar_mips32/drivers/soclib_tty.c:30:

kernel/kern/scheduler.h:80:26: note: expected 'char *' but argument is of type 'const char *'

void sched_yield( char * cause );

~

`

Location:
trunk/kernel/kern
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/scheduler.c

    r469 r470  
    301301
    302302////////////////////////////////
    303 void sched_yield( char * cause )
     303void sched_yield( const char * cause )
    304304{
    305305    thread_t    * next;
  • trunk/kernel/kern/scheduler.h

    r457 r470  
    7878 * @ cause    : character string defining the scheduling cause.
    7979 ********************************************************************************************/
    80 void sched_yield( char * cause );
     80void sched_yield( const char * cause );
    8181
    8282/*********************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.