CDVDiso: Fix the code to compile without -fpermissive

* Add some 'const'
* Add some type cast: FILE* and char*


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3683 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut@gmail.com 2010-08-23 18:35:20 +00:00
parent d71cce5495
commit 4e8c50dc9e
5 changed files with 19 additions and 20 deletions

View File

@ -12,7 +12,6 @@ set(Output CDVDiso)
set(CommonFlags
-fvisibility=hidden
-Wall
-fpermissive
)
set(OptimizationFlags

View File

@ -91,7 +91,7 @@ void SysMessage(char *fmt, ...)
void OnFile_Ok()
{
gchar *File;
const gchar *File;
gtk_widget_hide(FileSel);
File = gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSel));
@ -183,7 +183,7 @@ void SysMessageLoc(char *fmt, ...)
void OnOk (GtkButton *button, gpointer user_data)
{
char *tmp;
const char *tmp;
stop = true;
tmp = gtk_entry_get_text(GTK_ENTRY(Edit));
@ -210,7 +210,7 @@ void OnCancel(GtkButton *button, gpointer user_data)
void OnFileSel_Ok()
{
gchar *File;
const gchar *File;
File = gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSel));
gtk_entry_set_text(GTK_ENTRY(Edit), File);
@ -278,7 +278,6 @@ EXPORT_C_(void) CDVDconfigure()
gtk_widget_show_all(ConfDlg);
gtk_main();
return 0;
}
void OnAboutOk(GtkMenuItem * menuitem, gpointer userdata)

View File

@ -45,7 +45,7 @@ void OnStop(GtkButton *button, gpointer user_data)
void UpdZmode()
{
char *tmp;
const char *tmp;
tmp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(Method)->entry));
if (!strcmp(tmp, methods[0])) Zmode = 1;
@ -60,7 +60,7 @@ void OnCompress(GtkButton *button, gpointer user_data)
u32 lsn;
u8 cdbuff[10*2352];
char Zfile[256];
char *tmp;
const char *tmp;
int ret;
isoFile *src;
isoFile *dst;
@ -334,7 +334,7 @@ long CDR_getTD(unsigned char track, unsigned char *buffer)
// byte 0 - minute
// byte 1 - second
// byte 2 - frame
char *CDR_readTrack(unsigned char *time)
unsigned char *CDR_readTrack(unsigned char *time)
{
cr.msf.cdmsf_min0 = time[0];
cr.msf.cdmsf_sec0 = time[1];
@ -356,7 +356,7 @@ void OnCreate(GtkButton *button, gpointer user_data)
unsigned char *buffer;
unsigned char bufferz[2352];
unsigned char start[4], end[4];
char *tmp;
const char *tmp;
#ifdef VERBOSE
unsigned long count = 0;
int i = 0;
@ -495,7 +495,7 @@ void OnCreateZ(GtkButton *button, gpointer user_data)
unsigned char bufferz[2352];
unsigned char start[4], end[4];
char table[256];
char *tmp;
const char *tmp;
int b, blocks;
#ifdef VERBOSE
unsigned long count = 0;
@ -618,7 +618,7 @@ void OnCreateZ(GtkButton *button, gpointer user_data)
if (Zmode == 1)
compress(Zbuf, &size, cdbuffer, CD_FRAMESIZE_RAW);
else
BZ2_bzBuffToBuffCompress(Zbuf, (unsigned int*)&size, cdbuffer, CD_FRAMESIZE_RAW * 10, 1, 0, 30);
BZ2_bzBuffToBuffCompress((char*)Zbuf, (unsigned int*)&size, (char*)cdbuffer, CD_FRAMESIZE_RAW * 10, 1, 0, 30);
fwrite(&c, 1, 4, t);
if (Zmode == 1) fwrite(&size, 1, 2, t);

View File

@ -166,7 +166,7 @@ int _readfile(void *handle, void *dst, int size)
return ret;
}
int _writefile(void *handle, void *src, int size)
int _writefile(void *handle, const void *src, int size)
{
DWORD ret;
@ -198,11 +198,12 @@ void *_openfile(const char *filename, int flags)
u64 _tellfile(void *handle)
{
s64 cursize = ftell(handle);
FILE* fp = (FILE*)handle;
s64 cursize = ftell(fp);
if (cursize == -1)
{
// try 64bit
cursize = ftello64(handle);
cursize = ftello64(fp);
if (cursize < -1)
{
// zero top 32 bits
@ -214,7 +215,7 @@ u64 _tellfile(void *handle)
int _seekfile(void *handle, u64 offset, int whence)
{
int seekerr = fseeko64(handle, offset, whence);
int seekerr = fseeko64((FILE*)handle, offset, whence);
if (seekerr == -1) printf("failed to seek\n");
@ -223,17 +224,17 @@ int _seekfile(void *handle, u64 offset, int whence)
int _readfile(void *handle, void *dst, int size)
{
return fread(dst, 1, size, handle);
return fread(dst, 1, size, (FILE*)handle);
}
int _writefile(void *handle, void *src, int size)
int _writefile(void *handle, const void *src, int size)
{
return fwrite(src, 1, size, handle);
return fwrite(src, 1, size, (FILE*)handle);
}
void _closefile(void *handle)
{
fclose(handle);
fclose((FILE*)handle);
}
#endif

View File

@ -61,7 +61,7 @@ void *_openfile(const char *filename, int flags);
u64 _tellfile(void *handle);
int _seekfile(void *handle, u64 offset, int whence);
int _readfile(void *handle, void *dst, int size);
int _writefile(void *handle, void *src, int size);
int _writefile(void *handle, const void *src, int size);
void _closefile(void *handle);
#endif /* __LIBISO_H__ */