diff system/file.cc @ 43:01aa5ddf7dc8

A lot of very minor improvements (deleted some unused variables, and other things like that...)
author thib
date Tue, 24 Mar 2009 19:45:48 +0000
parents 2c574c3d50a9
children 5f548e5957a8
line wrap: on
line diff
--- a/system/file.cc
+++ b/system/file.cc
@@ -137,7 +137,6 @@ ARCFILE::ARCFILE(char* aname) {
 }
 
 void ARCFILE::Init(void) {
-	int i;
 	if (! arc_atom.empty()) return;
 	if (arcname == 0) return;
 	/* ファイル数を得る */
@@ -265,7 +264,6 @@ char* DIRFILE::SearchFile(const char* fn
 }
 
 void ARCFILE::ListFiles(FILE* out) {
-	int i;
 	Init();
 	if (arc_atom.empty()) return;
 	// list file name...
@@ -377,7 +375,7 @@ int DIRFILE::CheckFileDeal(void) {
 	return flen;
 }
 void DIRFILE::ListupFiles(int fname_len) {
-	DIR* dir; int i;
+	DIR* dir;
 	fname_len *= 2;
 	dir = opendir(arcname);
 	if (dir == 0) { 
@@ -754,7 +752,6 @@ ARCINFO* FILESEARCH::Find(FILETYPE type,
 }
 
 char** FILESEARCH::ListAll(FILETYPE type) {
-	int i;
 	/* とりあえず searcher を初期化 */
 	Find(type, "THIS FILENAME MAY NOT EXIST IN THE FILE SYSTEM !!!");
 	if (searcher[type] == 0) return 0;
@@ -995,7 +992,7 @@ GRPCONV* GRPCONV::AssignConverter(const 
 	/* ファイルの内容に応じたコンバーターを割り当てる */
 	GRPCONV* conv = 0;
 	if (inlen < 10) return 0; /* invalid file */
-	if (conv == 0 && strncmp(inbuf, "PDT10", 5) == 0 || strncmp(inbuf, "PDT11", 5) == 0) { /* PDT10 or PDT11 */
+	if (strncmp(inbuf, "PDT10", 5) == 0 || strncmp(inbuf, "PDT11", 5) == 0) { /* PDT10 or PDT11 */
 		conv = new PDTCONV(inbuf, inlen, fname);
 		if (conv->data == 0) { delete conv; conv = 0;}
 	}
@@ -1493,7 +1490,7 @@ bool G00CONV::Read_Type0(char* image) {
 	const char* srcend = data + datalen;
 	char* dest = uncompress_data;
 	char* dstend = uncompress_data + uncompress_size;
-	while(lzExtract(Extract_DataType_G00Type0(), char(), src, dest, srcend, dstend));
+	while(lzExtract(Extract_DataType_G00Type0(), char(), src, dest, srcend, dstend)){};
 	// image にコピー
 	CopyRGB(image, uncompress_data);
 	delete[] uncompress_data;
@@ -1510,7 +1507,7 @@ bool G00CONV::Read_Type1(char* image) {
 	char* dest = uncompress_data;
 	char* destend = uncompress_data + uncompress_size;
 
-	while(lzExtract(Extract_DataType_SCN2k(), char(), src, dest, srcend, destend));
+	while(lzExtract(Extract_DataType_SCN2k(), char(), src, dest, srcend, destend)){};
 
 	int colortable[256];
 	memset(colortable, 0, sizeof(int)*256);
@@ -1555,7 +1552,7 @@ bool G00CONV::Read_Type2(char* image) {
 	const char* srcend = data + datalen;
 	char* dest = uncompress_data;
 	char* destend = uncompress_data + uncompress_size;
-	while(lzExtract(Extract_DataType_SCN2k(), char(), src, dest, srcend, destend));
+	while(lzExtract(Extract_DataType_SCN2k(), char(), src, dest, srcend, destend)){};
 
 	/* region_deal2 == region_deal のはず……*/
 	int region_deal2 = read_little_endian_int(uncompress_data);
@@ -1757,10 +1754,6 @@ void PNGCONV::png_read(png_structp png_p
 
 #if HAVE_LIBJPEG
 JPEGCONV::JPEGCONV(const char* _inbuf, int _inlen, const char* _filename) {
-	int w,h,type;
-	JSAMPARRAY rows, rows_orig; int i;
-	char* buf = 0;
-
 	struct jpeg_decompress_struct cinfo;
 	struct jpeg_error_mgr jerr;
 	cinfo.err = jpeg_std_error(&jerr);