summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-05-13 12:29:34 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-05-13 12:29:34 +0000
commit2382044ffca161910eb9e4bddf01a4bb2bc7481f (patch)
treeb1e3f9e08b47e60ad3f1ea3658794eb4f78cc4d1 /firmware
parent0631a1dcce95d2cde96dd205f85b7d849215aaa5 (diff)
downloadrockbox-2382044ffca161910eb9e4bddf01a4bb2bc7481f.tar.gz
rockbox-2382044ffca161910eb9e4bddf01a4bb2bc7481f.zip
Changing to C99 'bool' type
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@561 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/common/dir.c8
-rw-r--r--firmware/common/file.c6
-rw-r--r--firmware/drivers/lcd.h2
-rw-r--r--firmware/drivers/led.c2
-rw-r--r--firmware/drivers/led.h2
-rw-r--r--firmware/id3.c14
-rw-r--r--firmware/system.c4
-rw-r--r--firmware/types.h28
8 files changed, 19 insertions, 47 deletions
diff --git a/firmware/common/dir.c b/firmware/common/dir.c
index acc412c570..f7f61719a2 100644
--- a/firmware/common/dir.c
+++ b/firmware/common/dir.c
@@ -18,14 +18,14 @@
18 ****************************************************************************/ 18 ****************************************************************************/
19#include <stdio.h> 19#include <stdio.h>
20#include <string.h> 20#include <string.h>
21#include <stdbool.h>
21#include "fat.h" 22#include "fat.h"
22#include "dir.h" 23#include "dir.h"
23#include "debug.h" 24#include "debug.h"
24#include "types.h"
25 25
26static DIR thedir; 26static DIR thedir;
27static struct dirent theent; 27static struct dirent theent;
28static bool busy=FALSE; 28static bool busy=false;
29 29
30DIR* opendir(char* name) 30DIR* opendir(char* name)
31{ 31{
@@ -70,14 +70,14 @@ DIR* opendir(char* name)
70 } 70 }
71 } 71 }
72 72
73 busy = TRUE; 73 busy = true;
74 74
75 return &thedir; 75 return &thedir;
76} 76}
77 77
78int closedir(DIR* dir) 78int closedir(DIR* dir)
79{ 79{
80 busy=FALSE; 80 busy=false;
81 return 0; 81 return 0;
82} 82}
83 83
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 9d18c613bf..3b7a889833 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -18,9 +18,9 @@
18 ****************************************************************************/ 18 ****************************************************************************/
19#include <string.h> 19#include <string.h>
20#include <errno.h> 20#include <errno.h>
21#include <stdbool.h>
21#include "file.h" 22#include "file.h"
22#include "fat.h" 23#include "fat.h"
23#include "types.h"
24#include "dir.h" 24#include "dir.h"
25#include "debug.h" 25#include "debug.h"
26 26
@@ -111,13 +111,13 @@ int open(char* pathname, int flags)
111 111
112 openfiles[fd].cacheoffset = -1; 112 openfiles[fd].cacheoffset = -1;
113 openfiles[fd].fileoffset = 0; 113 openfiles[fd].fileoffset = 0;
114 openfiles[fd].busy = TRUE; 114 openfiles[fd].busy = true;
115 return fd; 115 return fd;
116} 116}
117 117
118int close(int fd) 118int close(int fd)
119{ 119{
120 openfiles[fd].busy = FALSE; 120 openfiles[fd].busy = false;
121 return 0; 121 return 0;
122} 122}
123 123
diff --git a/firmware/drivers/lcd.h b/firmware/drivers/lcd.h
index 3bbf89a92c..1034fcdba9 100644
--- a/firmware/drivers/lcd.h
+++ b/firmware/drivers/lcd.h
@@ -20,8 +20,8 @@
20#ifndef __LCD_H__ 20#ifndef __LCD_H__
21#define __LCD_H__ 21#define __LCD_H__
22 22
23#include <stdbool.h>
23#include "sh7034.h" 24#include "sh7034.h"
24#include "types.h"
25#include "config.h" 25#include "config.h"
26 26
27/* common functions */ 27/* common functions */
diff --git a/firmware/drivers/led.c b/firmware/drivers/led.c
index efc7123ffd..80e8469638 100644
--- a/firmware/drivers/led.c
+++ b/firmware/drivers/led.c
@@ -17,7 +17,7 @@
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20#include "types.h" 20#include <stdbool.h>
21#include "sh7034.h" 21#include "sh7034.h"
22#include "led.h" 22#include "led.h"
23 23
diff --git a/firmware/drivers/led.h b/firmware/drivers/led.h
index aeaa1cc476..9b2552f738 100644
--- a/firmware/drivers/led.h
+++ b/firmware/drivers/led.h
@@ -20,7 +20,7 @@
20#ifndef __LED_H__ 20#ifndef __LED_H__
21#define __LED_H__ 21#define __LED_H__
22 22
23#include "types.h" 23#include <stdbool.h>
24 24
25extern void led( bool on ); 25extern void led( bool on );
26 26
diff --git a/firmware/id3.c b/firmware/id3.c
index e4da9da1b6..a1cd7139c0 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -26,8 +26,8 @@
26#include <stdlib.h> 26#include <stdlib.h>
27#include <string.h> 27#include <string.h>
28#include <errno.h> 28#include <errno.h>
29#include <stdbool.h>
29#include "file.h" 30#include "file.h"
30#include "types.h"
31 31
32#include "id3.h" 32#include "id3.h"
33 33
@@ -107,7 +107,7 @@ stripspaces(char *buffer)
107 * Arguments: file - the MP3 file to scen for a ID3v1 tag 107 * Arguments: file - the MP3 file to scen for a ID3v1 tag
108 * entry - the entry to set the title in 108 * entry - the entry to set the title in
109 * 109 *
110 * Returns: TRUE if a title was found and created, else FALSE 110 * Returns: true if a title was found and created, else false
111 */ 111 */
112static bool 112static bool
113setid3v1title(int fd, mp3entry *entry) 113setid3v1title(int fd, mp3entry *entry)
@@ -119,7 +119,7 @@ setid3v1title(int fd, mp3entry *entry)
119 119
120 for(i=0;i<3;i++) { 120 for(i=0;i<3;i++) {
121 if(-1 == lseek(fd, offsets[i], SEEK_END)) 121 if(-1 == lseek(fd, offsets[i], SEEK_END))
122 return FALSE; 122 return false;
123 123
124 buffer[30]=0; 124 buffer[30]=0;
125 read(fd, buffer, 30); 125 read(fd, buffer, 30);
@@ -143,7 +143,7 @@ setid3v1title(int fd, mp3entry *entry)
143 } 143 }
144 } 144 }
145 145
146 return TRUE; 146 return true;
147} 147}
148 148
149 149
@@ -153,7 +153,7 @@ setid3v1title(int fd, mp3entry *entry)
153 * Arguments: file - the MP3 file to scen for a ID3v2 tag 153 * Arguments: file - the MP3 file to scen for a ID3v2 tag
154 * entry - the entry to set the title in 154 * entry - the entry to set the title in
155 * 155 *
156 * Returns: TRUE if a title was found and created, else FALSE 156 * Returns: true if a title was found and created, else false
157 */ 157 */
158static void 158static void
159setid3v2title(int fd, mp3entry *entry) 159setid3v2title(int fd, mp3entry *entry)
@@ -484,7 +484,7 @@ mp3info(mp3entry *entry, char *filename)
484 int fd; 484 int fd;
485 fd = open(filename, O_RDONLY); 485 fd = open(filename, O_RDONLY);
486 if(-1 == fd) 486 if(-1 == fd)
487 return TRUE; 487 return true;
488 488
489 memset(entry, 0, sizeof(mp3entry)); 489 memset(entry, 0, sizeof(mp3entry));
490 490
@@ -504,7 +504,7 @@ mp3info(mp3entry *entry, char *filename)
504 504
505 close(fd); 505 close(fd);
506 506
507 return FALSE; 507 return false;
508} 508}
509 509
510#ifdef DEBUG_STANDALONE 510#ifdef DEBUG_STANDALONE
diff --git a/firmware/system.c b/firmware/system.c
index b176da44aa..cc039b3c7e 100644
--- a/firmware/system.c
+++ b/firmware/system.c
@@ -318,10 +318,10 @@ void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */
318 318
319 while (1) 319 while (1)
320 { 320 {
321 bool state = TRUE; 321 bool state = true;
322 322
323 led (state); 323 led (state);
324 state = state?FALSE:TRUE; 324 state = state?false:true;
325 325
326 for (i = 0; i < 240000; ++i); 326 for (i = 0; i < 240000; ++i);
327 } 327 }
diff --git a/firmware/types.h b/firmware/types.h
deleted file mode 100644
index 2586645a9f..0000000000
--- a/firmware/types.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Daniel Stenberg
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#ifndef __TYPES_H
21#define __TYPES_H
22
23typedef unsigned int bool;
24
25#define TRUE 1
26#define FALSE 0
27
28#endif