Ticket #2443: str.diff

File str.diff, 2.5 KB (added by monni, 16 years ago)

Patch implementing strlwr, strupr, fix warning about missing prototype for strtoul

  • src/system/libroot/posix/string/Jamfile

     
    2525    strerror.c
    2626    strlcat.c
    2727    strlcpy.c
     28    strlwr.c
    2829    strncat.c
    2930    strncmp.c
    3031    strncpy.c
     
    3435    strspn.c
    3536    strstr.c
    3637    strtok.c
     38    strupr.c
    3739    strxfrm.c
    3840;
    3941
  • src/system/libroot/posix/string/strlwr.c

     
     1/*
     2** Copyright 2008, Mika Lindqvist. All rights reserved.
     3** Distributed under the terms of the Haiku License.
     4*/
     5
     6#include <ctype.h>
     7#include <string.h>
     8
     9char *
     10strlwr(char *str)
     11{
     12    char *c = str;
     13    while(*c) {
     14        *c = tolower(*c);
     15        c++;
     16    }
     17    return(str);
     18}
     19
  • src/system/libroot/posix/string/strupr.c

     
     1/*
     2** Copyright 2008, Mika Lindqvist. All rights reserved.
     3** Distributed under the terms of the Haiku License.
     4*/
     5
     6#include <ctype.h>
     7#include <string.h>
     8
     9char *
     10strupr(char *str)
     11{
     12    char *c = str;
     13    while(*c) {
     14        *c = toupper(*c);
     15        c++;
     16    }
     17    return(str);
     18}
     19
  • src/system/kernel/lib/Jamfile

     
    109109    strspn.c
    110110    strstr.c
    111111    strtok.c
     112    strupr.c
    112113
    113114    : $(TARGET_KERNEL_PIC_CCFLAGS)
    114115;
  • src/add-ons/kernel/bus_managers/acpi/include/platform/achaiku.h

     
    138138#include <string.h>
    139139#include <ctype.h>
    140140#include <stdarg.h>
     141#include <stdlib.h>
    141142
    142143#define asm         __asm
    143144
     
    206207} while (0)
    207208
    208209
    209 /* Kernel doesn't have strupr, should be fixed. */
    210 static __inline char *
    211 strupr(char *str)
    212 {
    213     char *c = str;
    214     while(*c) {
    215         *c = toupper(*c);
    216         c++;
    217     }
    218     return(str);
    219 }
    220 
    221210#else /* _KERNEL_MODE */
    222211
    223212#include <ctype.h>