[CDMAKE]: Code cleanup (remove useless comments and that setjmp thingie).

svn path=/trunk/; revision=66137
This commit is contained in:
Hermès Bélusca-Maïto 2015-02-01 12:39:37 +00:00
parent 30701b9657
commit 5a6cb60c3d
2 changed files with 10 additions and 20 deletions

View file

@ -64,7 +64,6 @@
# define FALSE 0 # define FALSE 0
#endif // _WIN32 #endif // _WIN32
#include <ctype.h> #include <ctype.h>
#include <setjmp.h>
#include <time.h> #include <time.h>
#include "config.h" #include "config.h"
#include "dirhash.h" #include "dirhash.h"
@ -131,7 +130,6 @@ typedef struct directory_record
WORD path_table_index; /* directory record only */ WORD path_table_index; /* directory record only */
} DIR_RECORD, *PDIR_RECORD; } DIR_RECORD, *PDIR_RECORD;
typedef enum directory_record_type typedef enum directory_record_type
{ {
DOT_RECORD, DOT_RECORD,
@ -147,7 +145,6 @@ PDIR_RECORD sort_linked_list(PDIR_RECORD,
static char DIRECTORY_TIMESTAMP[] = "~Y$'KOR$.3K&"; static char DIRECTORY_TIMESTAMP[] = "~Y$'KOR$.3K&";
static jmp_buf error;
static struct cd_image cd; static struct cd_image cd;
char volume_label[32]; char volume_label[32];
@ -570,14 +567,14 @@ static int check_for_punctuation(int c, const char *name)
return c; return c;
} }
#if defined(_WIN32) && !defined(strcasecmp)
#define strcasecmp stricmp
#endif//_WIN32
/*----------------------------------------------------------------------------- /*-----------------------------------------------------------------------------
This function checks to see if there's a cdname conflict. This function checks to see if there's a cdname conflict.
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#if defined(_WIN32) && !defined(strcasecmp)
#define strcasecmp stricmp
#endif//_WIN32
int cdname_exists(PDIR_RECORD d) int cdname_exists(PDIR_RECORD d)
{ {
PDIR_RECORD p = d->parent->first_record; PDIR_RECORD p = d->parent->first_record;
@ -722,11 +719,6 @@ new_directory_record(struct dirent *entry,
PDIR_RECORD parent) PDIR_RECORD parent)
{ {
PDIR_RECORD d; PDIR_RECORD d;
/*
char *s;
char *t;
char *n;
*/
d = calloc(1, sizeof(*d)); d = calloc(1, sizeof(*d));
if (d == NULL) if (d == NULL)
@ -1117,8 +1109,8 @@ new_empty_dirrecord(PDIR_RECORD d, BOOL directory)
new_d->next_in_directory = d->first_record; new_d->next_in_directory = d->first_record;
d->first_record = new_d; d->first_record = new_d;
new_d->next_in_memory = root.next_in_memory; new_d->next_in_memory = root.next_in_memory;
new_d->date_and_time = d->date_and_time;
root.next_in_memory = new_d; root.next_in_memory = new_d;
new_d->date_and_time = d->date_and_time;
if (directory) if (directory)
{ {
new_d->flags |= DIRECTORY_FLAG; new_d->flags |= DIRECTORY_FLAG;
@ -1730,9 +1722,6 @@ int main(int argc, char **argv)
return 1; return 1;
} }
if (setjmp(error))
return 1;
// initialize root directory // initialize root directory
cd.buffer = malloc(BUFFER_SIZE); cd.buffer = malloc(BUFFER_SIZE);
@ -1775,7 +1764,7 @@ int main(int argc, char **argv)
error_exit("Missing size limit parameter"); error_exit("Missing size limit parameter");
} }
while (isdigit(*t)) while (isdigit(*t))
size_limit = size_limit * 10 + *t++ - '0'; size_limit = size_limit * 10 + *t++ - '0';
if (size_limit < 1 || size_limit > 800) if (size_limit < 1 || size_limit > 800)
error_exit("Invalid size limit"); error_exit("Invalid size limit");
size_limit <<= 9; // convert megabyte to sector count size_limit <<= 9; // convert megabyte to sector count
@ -1838,6 +1827,7 @@ int main(int argc, char **argv)
{ {
char *trimmedline, *targetname, *srcname, *eq; char *trimmedline, *targetname, *srcname, *eq;
char lineread[1024]; char lineread[1024];
FILE *f = fopen(source+1, "r"); FILE *f = fopen(source+1, "r");
if (!f) if (!f)
{ {

View file

@ -1,5 +1,5 @@
#ifndef _REACTOS_TOOLS_CDMAKE_DIRHASH_H_ #ifndef _DIRHASH_H_
#define _REACTOS_TOOLS_CDMAKE_DIRHASH_H_ #define _DIRHASH_H_
#define NUM_DIR_HASH_BUCKETS 1024 #define NUM_DIR_HASH_BUCKETS 1024
@ -35,4 +35,4 @@ struct target_dir_entry *
dir_hash_create_dir(struct target_dir_hash *dh, const char *casename, const char *targetnorm); dir_hash_create_dir(struct target_dir_hash *dh, const char *casename, const char *targetnorm);
void dir_hash_destroy(struct target_dir_hash *dh); void dir_hash_destroy(struct target_dir_hash *dh);
#endif //_REACTOS_TOOLS_CDMAKE_DIRHASH_H_ #endif // _DIRHASH_H_