Skip to content

Commit 29551ba

Browse files
committed
cc3200: Move stoupper to ftp.c and define in terms of unichar_toupper.
ftp.c is the only user of this function so making it static in that file allows it to be inlined. Also, reusing unichar_toupper means we no longer depend on the C stdlib for toupper, saving about 300 bytes of code space.
1 parent 465a604 commit 29551ba

3 files changed

Lines changed: 7 additions & 10 deletions

File tree

cc3200/ftp/ftp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,13 @@ static void ftp_close_cmd_data (void) {
932932
ftp_close_filesystem_on_error ();
933933
}
934934

935+
static void stoupper (char *str) {
936+
while (str && *str != '\0') {
937+
*str = (char)unichar_toupper((int)(*str));
938+
str++;
939+
}
940+
}
941+
935942
static ftp_cmd_index_t ftp_pop_command (char **str) {
936943
char _cmd[FTP_CMD_SIZE_MAX];
937944
ftp_pop_param (str, _cmd);

cc3200/main.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,6 @@ int main (void) {
9898
for ( ; ; );
9999
}
100100

101-
void stoupper (char *str) {
102-
while (str && *str != '\0') {
103-
*str = (char)toupper((int)(*str));
104-
str++;
105-
}
106-
}
107-
108101
// We need this when configSUPPORT_STATIC_ALLOCATION is enabled
109102
void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer,
110103
StackType_t **ppxIdleTaskStackBuffer,

cc3200/util/std.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,3 @@ typedef unsigned int size_t;
3131

3232
int printf(const char *fmt, ...);
3333
int snprintf(char *str, size_t size, const char *fmt, ...);
34-
35-
// Convenience function, defined in main.c.
36-
void stoupper (char *str);

0 commit comments

Comments
 (0)