Search
lxdream.org :: lxdream/src/gdrom/gdimage.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdrom/gdimage.c
changeset 422:61a0598e07ff
prev342:850502f0e8de
next464:8e099fad42a6
author nkeynes
date Sat Oct 06 09:03:24 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change Fix compilation warnings
file annotate diff log raw
1.1 --- a/src/gdrom/gdimage.c Wed Jan 31 10:58:42 2007 +0000
1.2 +++ b/src/gdrom/gdimage.c Sat Oct 06 09:03:24 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: gdimage.c,v 1.1 2007-01-31 10:58:42 nkeynes Exp $
1.6 + * $Id: gdimage.c,v 1.2 2007-10-06 08:58:00 nkeynes Exp $
1.7 *
1.8 * GD-Rom image-file common functions.
1.9 *
1.10 @@ -16,15 +16,18 @@
1.11 * GNU General Public License for more details.
1.12 */
1.13
1.14 +#include <netinet/in.h>
1.15 +
1.16 #include "gdrom/gdrom.h"
1.17 #include "gdrom/packet.h"
1.18 +#include "bootstrap.h"
1.19
1.20 static void gdrom_image_destroy( gdrom_disc_t disc );
1.21 static gdrom_error_t gdrom_image_read_sector( gdrom_disc_t disc, uint32_t lba, int mode,
1.22 - char *buf, uint32_t *readlength );
1.23 -static gdrom_error_t gdrom_image_read_toc( gdrom_disc_t disc, char *buf );
1.24 -static gdrom_error_t gdrom_image_read_session( gdrom_disc_t disc, int session, char *buf );
1.25 -static gdrom_error_t gdrom_image_read_position( gdrom_disc_t disc, uint32_t lba, char *buf );
1.26 + unsigned char *buf, uint32_t *readlength );
1.27 +static gdrom_error_t gdrom_image_read_toc( gdrom_disc_t disc, unsigned char *buf );
1.28 +static gdrom_error_t gdrom_image_read_session( gdrom_disc_t disc, int session, unsigned char *buf );
1.29 +static gdrom_error_t gdrom_image_read_position( gdrom_disc_t disc, uint32_t lba, unsigned char *buf );
1.30 static int gdrom_image_drive_status( gdrom_disc_t disc );
1.31
1.32
1.33 @@ -81,10 +84,10 @@
1.34 }
1.35
1.36 static gdrom_error_t gdrom_image_read_sector( gdrom_disc_t disc, uint32_t lba,
1.37 - int mode, char *buf, uint32_t *length )
1.38 + int mode, unsigned char *buf, uint32_t *length )
1.39 {
1.40 gdrom_image_t image = (gdrom_image_t)disc;
1.41 - int i, file_offset, read_len, track_no;
1.42 + int file_offset, read_len, track_no;
1.43
1.44 track_no = gdrom_image_get_track_by_lba( image, lba );
1.45 if( track_no == -1 ) {
1.46 @@ -122,7 +125,7 @@
1.47
1.48 }
1.49
1.50 -static gdrom_error_t gdrom_image_read_toc( gdrom_disc_t disc, char *buf )
1.51 +static gdrom_error_t gdrom_image_read_toc( gdrom_disc_t disc, unsigned char *buf )
1.52 {
1.53 gdrom_image_t image = (gdrom_image_t)disc;
1.54 struct gdrom_toc *toc = (struct gdrom_toc *)buf;
1.55 @@ -140,7 +143,7 @@
1.56 return PKT_ERR_OK;
1.57 }
1.58
1.59 -static gdrom_error_t gdrom_image_read_session( gdrom_disc_t disc, int session, char *buf )
1.60 +static gdrom_error_t gdrom_image_read_session( gdrom_disc_t disc, int session, unsigned char *buf )
1.61 {
1.62 gdrom_image_t image = (gdrom_image_t)disc;
1.63 struct gdrom_track *last_track = &image->track[image->track_count-1];
1.64 @@ -170,7 +173,7 @@
1.65 }
1.66 }
1.67
1.68 -static gdrom_error_t gdrom_image_read_position( gdrom_disc_t disc, uint32_t lba, char *buf )
1.69 +static gdrom_error_t gdrom_image_read_position( gdrom_disc_t disc, uint32_t lba, unsigned char *buf )
1.70 {
1.71 gdrom_image_t image = (gdrom_image_t)disc;
1.72 int track_no = gdrom_image_get_track_by_lba( image, lba );
1.73 @@ -190,6 +193,7 @@
1.74 buf[11] = (lba >> 16) & 0xFF;
1.75 buf[12] = (lba >> 8) & 0xFF;
1.76 buf[13] = lba & 0xFF;
1.77 + return PKT_ERR_OK;
1.78 }
1.79
1.80 static int gdrom_image_drive_status( gdrom_disc_t disc )
1.81 @@ -217,7 +221,7 @@
1.82 }
1.83 }
1.84 if( boot_track != -1 ) {
1.85 - char boot_sector[MAX_SECTOR_SIZE];
1.86 + unsigned char boot_sector[MAX_SECTOR_SIZE];
1.87 uint32_t length = sizeof(boot_sector);
1.88 if( d->read_sector( d, disc->track[boot_track].lba, 0x28,
1.89 boot_sector, &length ) == PKT_ERR_OK ) {
.