Skip to content

Commit 06d0d0a

Browse files
committed
file descriptor is now void *
1 parent 3ce0f6b commit 06d0d0a

File tree

8 files changed

+43
-41
lines changed

8 files changed

+43
-41
lines changed

libiso9660/iso9660.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static int _ISO9660_open_r(struct _reent *r, void *fileStruct, const char *path,
477477
return (int) file;
478478
}
479479

480-
static int _ISO9660_close_r(struct _reent *r, int fd)
480+
static int _ISO9660_close_r(struct _reent *r, void *fd)
481481
{
482482
FILE_STRUCT *file = (FILE_STRUCT*) fd;
483483

@@ -491,7 +491,7 @@ static int _ISO9660_close_r(struct _reent *r, int fd)
491491
return 0;
492492
}
493493

494-
static ssize_t _ISO9660_read_r(struct _reent *r, int fd, char *ptr, size_t len)
494+
static ssize_t _ISO9660_read_r(struct _reent *r, void *fd, char *ptr, size_t len)
495495
{
496496
u64 offset;
497497
int ret;
@@ -530,7 +530,7 @@ static ssize_t _ISO9660_read_r(struct _reent *r, int fd, char *ptr, size_t len)
530530
return len;
531531
}
532532

533-
static off_t _ISO9660_seek_r(struct _reent *r, int fd, off_t pos, int dir)
533+
static off_t _ISO9660_seek_r(struct _reent *r, void *fd, off_t pos, int dir)
534534
{
535535
off_t position;
536536
FILE_STRUCT *file = (FILE_STRUCT*) fd;
@@ -573,7 +573,7 @@ static off_t _ISO9660_seek_r(struct _reent *r, int fd, off_t pos, int dir)
573573
return position;
574574
}
575575

576-
static int _ISO9660_fstat_r(struct _reent *r, int fd, struct stat *st)
576+
static int _ISO9660_fstat_r(struct _reent *r, void *fd, struct stat *st)
577577
{
578578
FILE_STRUCT *file = (FILE_STRUCT*) fd;
579579

libogc/console.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ static int __console_parse_escsequence(char *pchr)
499499
return(i);
500500
}
501501

502-
int __console_write(struct _reent *r,int fd,const char *ptr,size_t len)
502+
int __console_write(struct _reent *r,void *fd,const char *ptr,size_t len)
503503
{
504504
size_t i = 0;
505505
char *tmp = (char*)ptr;

libogc/console.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ typedef struct _console_data_s {
2222
unsigned int foreground,background;
2323
} console_data_s;
2424

25-
extern int __console_write(struct _reent *r,int fd,const char *ptr,size_t len);
25+
extern int __console_write(struct _reent *r,void *fd,const char *ptr,size_t len);
2626
extern void __console_init(void *framebuffer,int xstart,int ystart,int xres,int yres,int stride);
2727

2828
//extern const devoptab_t dotab_stdout;

libogc/es.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ static int _ES_open_r (struct _reent *r, void *fileStruct, const char *path, int
936936
return (int)file;
937937
}
938938

939-
static int _ES_close_r (struct _reent *r, int fd) {
939+
static int _ES_close_r (struct _reent *r, void *fd) {
940940
es_fd *file = (es_fd *) fd;
941941

942942
LWP_MutexLock(file->mutex);
@@ -954,7 +954,7 @@ static int _ES_close_r (struct _reent *r, int fd) {
954954
return 0;
955955
}
956956

957-
static int _ES_read_r (struct _reent *r, int fd, char *ptr, size_t len) {
957+
static int _ES_read_r (struct _reent *r, void *fd, char *ptr, size_t len) {
958958
es_fd *file = (es_fd *) fd;
959959
int read = 0;
960960
int res;
@@ -1010,7 +1010,7 @@ static int _ES_read_r (struct _reent *r, int fd, char *ptr, size_t len) {
10101010
return read;
10111011
}
10121012

1013-
static off_t _ES_seek_r (struct _reent *r, int fd, off_t where, int whence) {
1013+
static off_t _ES_seek_r (struct _reent *r, void *fd, off_t where, int whence) {
10141014
es_fd *file = (es_fd *) fd;
10151015
s32 res;
10161016

@@ -1062,7 +1062,7 @@ static void _ES_fillstat(u64 titleID, tmd_content *content, struct stat *st) {
10621062
st->st_blksize = 16384;
10631063
}
10641064

1065-
static int _ES_fstat_r (struct _reent *r, int fd, struct stat *st) {
1065+
static int _ES_fstat_r (struct _reent *r, void *fd, struct stat *st) {
10661066
es_fd *file = (es_fd *) fd;
10671067

10681068
LWP_MutexLock(file->mutex);

libtinysmb/smb_devoptab.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ static int __smb_open(struct _reent *r, void *fileStruct, const char *path, int
631631
return 0;
632632
}
633633

634-
static off_t __smb_seek(struct _reent *r, int fd, off_t pos, int dir)
634+
static off_t __smb_seek(struct _reent *r, void *fd, off_t pos, int dir)
635635
{
636636
SMBFILESTRUCT *file = (SMBFILESTRUCT*) fd;
637637
off_t position;
@@ -685,7 +685,7 @@ static off_t __smb_seek(struct _reent *r, int fd, off_t pos, int dir)
685685
return position;
686686
}
687687

688-
static ssize_t __smb_read(struct _reent *r, int fd, char *ptr, size_t len)
688+
static ssize_t __smb_read(struct _reent *r, void *fd, char *ptr, size_t len)
689689
{
690690
size_t offset = 0;
691691
size_t readsize;
@@ -772,7 +772,7 @@ static ssize_t __smb_read(struct _reent *r, int fd, char *ptr, size_t len)
772772
return len;
773773
}
774774

775-
static ssize_t __smb_write(struct _reent *r, int fd, const char *ptr, size_t len)
775+
static ssize_t __smb_write(struct _reent *r, void *fd, const char *ptr, size_t len)
776776
{
777777
SMBFILESTRUCT *file = (SMBFILESTRUCT*) fd;
778778
int written;
@@ -806,7 +806,7 @@ static ssize_t __smb_write(struct _reent *r, int fd, const char *ptr, size_t len
806806
return written;
807807
}
808808

809-
static int __smb_close(struct _reent *r, int fd)
809+
static int __smb_close(struct _reent *r, void *fd)
810810
{
811811
SMBFILESTRUCT *file = (SMBFILESTRUCT*) fd;
812812
int j;
@@ -1223,7 +1223,7 @@ static int __smb_stat(struct _reent *r, const char *path, struct stat *st)
12231223
return 0;
12241224
}
12251225

1226-
static int __smb_fstat(struct _reent *r, int fd, struct stat *st)
1226+
static int __smb_fstat(struct _reent *r, void *fd, struct stat *st)
12271227
{
12281228
SMBFILESTRUCT *filestate = (SMBFILESTRUCT *) fd;
12291229

libwiikeyboard/keyboard.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ static void * _kbd_buf_thread_func(void *arg) {
444444
return NULL;
445445
}
446446

447-
static ssize_t _keyboardRead(struct _reent *r, int unused, char *ptr, size_t len)
447+
static ssize_t _keyboardRead(struct _reent *r, void *unused, char *ptr, size_t len)
448448
{
449449
ssize_t count = len;
450450
while ( count > 0 ) {

lwip/netio.c

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if 0
12
#include <stdlib.h>
23
#include <string.h>
34
#include <reent.h>
@@ -9,33 +10,33 @@ extern int errno;
910
#include "lwip/ip_addr.h"
1011
#include "network.h"
1112
int netio_open(struct _reent *r, void *fileStruct, const char *path,int flags,int mode);
12-
int netio_close(struct _reent *r,int fd);
13-
int netio_write(struct _reent *r,int fd,const char *ptr,size_t len);
14-
int netio_read(struct _reent *r,int fd,char *ptr,size_t len);
13+
int netio_close(struct _reent *r,void *fd);
14+
int netio_write(struct _reent *r,void *fd,const char *ptr,size_t len);
15+
int netio_read(struct _reent *r,void *fd,char *ptr,size_t len);
1516

1617
//---------------------------------------------------------------------------------
1718
const devoptab_t dotab_stdnet = {
1819
//---------------------------------------------------------------------------------
19-
"stdnet", // device name
20-
0, // size of file structure
21-
netio_open, // device open
20+
"stdnet", // device name
21+
0, // size of file structure
22+
netio_open, // device open
2223
netio_close, // device close
2324
netio_write, // device write
24-
netio_read, // device read
25-
NULL, // device seek
26-
NULL, // device fstat
27-
NULL, // device stat
28-
NULL, // device link
29-
NULL, // device unlink
30-
NULL, // device chdir
31-
NULL, // device rename
32-
NULL, // device mkdir
33-
0, // dirStateSize
34-
NULL, // device diropen_r
35-
NULL, // device dirreset_r
36-
NULL, // device dirnext_r
37-
NULL, // device dirclose_r
38-
NULL // device statvfs_r
25+
netio_read, // device read
26+
NULL, // device seek
27+
NULL, // device fstat
28+
NULL, // device stat
29+
NULL, // device link
30+
NULL, // device unlink
31+
NULL, // device chdir
32+
NULL, // device rename
33+
NULL, // device mkdir
34+
0, // dirStateSize
35+
NULL, // device diropen_r
36+
NULL, // device dirreset_r
37+
NULL, // device dirnext_r
38+
NULL, // device dirclose_r
39+
NULL // device statvfs_r
3940
};
4041

4142
int netio_open(struct _reent *r, void *fileStruct, const char *path,int flags,int mode)
@@ -69,7 +70,7 @@ int netio_open(struct _reent *r, void *fileStruct, const char *path,int flags,in
6970
return udp_sock;
7071
}
7172

72-
int netio_close(struct _reent *r,int fd)
73+
int netio_close(struct _reent *r,void *fd)
7374
{
7475
if(fd<0) return -1;
7576

@@ -78,7 +79,7 @@ int netio_close(struct _reent *r,int fd)
7879
return 0;
7980
}
8081

81-
int netio_write(struct _reent *r,int fd,const char *ptr,size_t len)
82+
int netio_write(struct _reent *r,void *fd,const char *ptr,size_t len)
8283
{
8384
int ret;
8485

@@ -89,7 +90,7 @@ int netio_write(struct _reent *r,int fd,const char *ptr,size_t len)
8990
return ret;
9091
}
9192

92-
int netio_read(struct _reent *r,int fd,char *ptr,size_t len)
93+
int netio_read(struct _reent *r,void *fd,char *ptr,size_t len)
9394
{
9495
int ret;
9596

@@ -99,3 +100,4 @@ int netio_read(struct _reent *r,int fd,char *ptr,size_t len)
99100

100101
return ret;
101102
}
103+
#endif

lwip/network.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ s32 if_configex(struct in_addr *local_ip,struct in_addr *netmask,struct in_addr
14621462
if(g_netinitiated) return 0;
14631463
g_netinitiated = 1;
14641464

1465-
AddDevice(&dotab_stdnet);
1465+
// AddDevice(&dotab_stdnet);
14661466
#ifdef STATS
14671467
stats_init();
14681468
#endif /* STATS */

0 commit comments

Comments
 (0)