forked from len0rd/rockbox
Changing to C99 'bool' type
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@561 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0631a1dcce
commit
2382044ffc
8 changed files with 19 additions and 47 deletions
|
@ -18,14 +18,14 @@
|
|||
****************************************************************************/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include "fat.h"
|
||||
#include "dir.h"
|
||||
#include "debug.h"
|
||||
#include "types.h"
|
||||
|
||||
static DIR thedir;
|
||||
static struct dirent theent;
|
||||
static bool busy=FALSE;
|
||||
static bool busy=false;
|
||||
|
||||
DIR* opendir(char* name)
|
||||
{
|
||||
|
@ -70,14 +70,14 @@ DIR* opendir(char* name)
|
|||
}
|
||||
}
|
||||
|
||||
busy = TRUE;
|
||||
busy = true;
|
||||
|
||||
return &thedir;
|
||||
}
|
||||
|
||||
int closedir(DIR* dir)
|
||||
{
|
||||
busy=FALSE;
|
||||
busy=false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
****************************************************************************/
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include "file.h"
|
||||
#include "fat.h"
|
||||
#include "types.h"
|
||||
#include "dir.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
@ -111,13 +111,13 @@ int open(char* pathname, int flags)
|
|||
|
||||
openfiles[fd].cacheoffset = -1;
|
||||
openfiles[fd].fileoffset = 0;
|
||||
openfiles[fd].busy = TRUE;
|
||||
openfiles[fd].busy = true;
|
||||
return fd;
|
||||
}
|
||||
|
||||
int close(int fd)
|
||||
{
|
||||
openfiles[fd].busy = FALSE;
|
||||
openfiles[fd].busy = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
#ifndef __LCD_H__
|
||||
#define __LCD_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "sh7034.h"
|
||||
#include "types.h"
|
||||
#include "config.h"
|
||||
|
||||
/* common functions */
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include "types.h"
|
||||
#include <stdbool.h>
|
||||
#include "sh7034.h"
|
||||
#include "led.h"
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef __LED_H__
|
||||
#define __LED_H__
|
||||
|
||||
#include "types.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
extern void led( bool on );
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include "file.h"
|
||||
#include "types.h"
|
||||
|
||||
#include "id3.h"
|
||||
|
||||
|
@ -107,7 +107,7 @@ stripspaces(char *buffer)
|
|||
* Arguments: file - the MP3 file to scen for a ID3v1 tag
|
||||
* entry - the entry to set the title in
|
||||
*
|
||||
* Returns: TRUE if a title was found and created, else FALSE
|
||||
* Returns: true if a title was found and created, else false
|
||||
*/
|
||||
static bool
|
||||
setid3v1title(int fd, mp3entry *entry)
|
||||
|
@ -119,7 +119,7 @@ setid3v1title(int fd, mp3entry *entry)
|
|||
|
||||
for(i=0;i<3;i++) {
|
||||
if(-1 == lseek(fd, offsets[i], SEEK_END))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
buffer[30]=0;
|
||||
read(fd, buffer, 30);
|
||||
|
@ -143,7 +143,7 @@ setid3v1title(int fd, mp3entry *entry)
|
|||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -153,7 +153,7 @@ setid3v1title(int fd, mp3entry *entry)
|
|||
* Arguments: file - the MP3 file to scen for a ID3v2 tag
|
||||
* entry - the entry to set the title in
|
||||
*
|
||||
* Returns: TRUE if a title was found and created, else FALSE
|
||||
* Returns: true if a title was found and created, else false
|
||||
*/
|
||||
static void
|
||||
setid3v2title(int fd, mp3entry *entry)
|
||||
|
@ -484,7 +484,7 @@ mp3info(mp3entry *entry, char *filename)
|
|||
int fd;
|
||||
fd = open(filename, O_RDONLY);
|
||||
if(-1 == fd)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
memset(entry, 0, sizeof(mp3entry));
|
||||
|
||||
|
@ -504,7 +504,7 @@ mp3info(mp3entry *entry, char *filename)
|
|||
|
||||
close(fd);
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_STANDALONE
|
||||
|
|
|
@ -318,10 +318,10 @@ void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */
|
|||
|
||||
while (1)
|
||||
{
|
||||
bool state = TRUE;
|
||||
bool state = true;
|
||||
|
||||
led (state);
|
||||
state = state?FALSE:TRUE;
|
||||
state = state?false:true;
|
||||
|
||||
for (i = 0; i < 240000; ++i);
|
||||
}
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 by Daniel Stenberg
|
||||
*
|
||||
* All files in this archive are subject to the GNU General Public License.
|
||||
* See the file COPYING in the source tree root for full license agreement.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __TYPES_H
|
||||
#define __TYPES_H
|
||||
|
||||
typedef unsigned int bool;
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue