From f55f31a166ad892cea124b88a365f8e4c0e72d2c Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 24 Jan 2012 11:35:42 +0000 Subject: [PATCH] [iso] align to proposed libcdio fixes --- src/iso.c | 12 ------------ src/libcdio/cdio/ecma_167.h | 16 ++++++++-------- src/libcdio/udf/udf_file.c | 2 +- src/libcdio/udf/udf_fs.c | 6 +++--- src/rufus.rc | 12 ++++++------ 5 files changed, 18 insertions(+), 30 deletions(-) diff --git a/src/iso.c b/src/iso.c index bf01ed50..a5cf1f6a 100644 --- a/src/iso.c +++ b/src/iso.c @@ -71,18 +71,6 @@ const char *psz_extract_dir = "D:/tmp/iso"; // TODO: Unicode support, timestamp preservation -static void udf_print_file_info(const udf_dirent_t *p_udf_dirent, const char* psz_dirname) -{ - time_t mod_time = udf_get_modification_time(p_udf_dirent); - char psz_mode[11] = "invalid"; - const char *psz_fname = psz_dirname?psz_dirname:udf_get_filename(p_udf_dirent); - - /* Print directory attributes*/ - uprintf("%s %4d %lu %s %s", udf_mode_string(udf_get_posix_filemode(p_udf_dirent), psz_mode), - udf_get_link_count(p_udf_dirent), (long unsigned int)udf_get_file_length(p_udf_dirent), - (*psz_fname?psz_fname:"/"), ctime(&mod_time)); -} - static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const char *psz_path) { FILE *fd = NULL; diff --git a/src/libcdio/cdio/ecma_167.h b/src/libcdio/cdio/ecma_167.h index bfbcd732..6e8a94cf 100644 --- a/src/libcdio/cdio/ecma_167.h +++ b/src/libcdio/cdio/ecma_167.h @@ -727,14 +727,14 @@ struct udf_file_entry_s udf_Uint64_t unique_ID; udf_Uint32_t i_extended_attr; udf_Uint32_t i_alloc_descs; -// udf_Uint8_t ext_attr[0]; - /* This may look wasteful, but if we didn't do it here, an UDF block - would still need to be allocated for each fe before truncation. - This also allows updates without worrying about overflows, as the - specs states that a file entry cannot be larger than a block */ - // TODO: use an union with padding to UDF_BLOCKSIZE (2048) - // Also, define UDF_BLOCKSIZE in this file - udf_Uint8_t ext_attr_alloc_descs[2048-176]; +/* The following union allows file entry reuse without worrying + about overflows, by ensuring the struct is always the + maximum possible size allowed by the specs: one UDF block. */ + union { + udf_Uint8_t ext_attr[0]; + udf_Uint8_t alloc_descs[0]; + udf_Uint8_t pad_to_one_block[2048-176]; + } u; } GNUC_PACKED; typedef struct udf_file_entry_s udf_file_entry_t; diff --git a/src/libcdio/udf/udf_file.c b/src/libcdio/udf/udf_file.c index ca1f66cd..521c0e73 100644 --- a/src/libcdio/udf/udf_file.c +++ b/src/libcdio/udf/udf_file.c @@ -34,7 +34,7 @@ #define CEILING(x, y) ((x+(y-1))/y) #define GETICB(offset) \ - &p_udf_fe->ext_attr_alloc_descs[offset] + &p_udf_fe->u.alloc_descs[offset] const char * udf_get_filename(const udf_dirent_t *p_udf_dirent) diff --git a/src/libcdio/udf/udf_fs.c b/src/libcdio/udf/udf_fs.c index dea4027d..d0e5685e 100644 --- a/src/libcdio/udf/udf_fs.c +++ b/src/libcdio/udf/udf_fs.c @@ -167,7 +167,7 @@ udf_get_lba(const udf_file_entry_t *p_udf_fe, { /* The allocation descriptor field is filled with short_ad's. */ udf_short_ad_t *p_ad = (udf_short_ad_t *) - (p_udf_fe->ext_attr_alloc_descs + p_udf_fe->i_extended_attr); + (p_udf_fe->u.ext_attr + p_udf_fe->i_extended_attr); *start = uint32_from_le(p_ad->pos); *end = *start + @@ -179,7 +179,7 @@ udf_get_lba(const udf_file_entry_t *p_udf_fe, { /* The allocation descriptor field is filled with long_ad's */ udf_long_ad_t *p_ad = (udf_long_ad_t *) - (p_udf_fe->ext_attr_alloc_descs + p_udf_fe->i_extended_attr); + (p_udf_fe->u.ext_attr + p_udf_fe->i_extended_attr); *start = uint32_from_le(p_ad->loc.lba); /* ignore partition number */ *end = *start + @@ -190,7 +190,7 @@ udf_get_lba(const udf_file_entry_t *p_udf_fe, case ICBTAG_FLAG_AD_EXTENDED: { udf_ext_ad_t *p_ad = (udf_ext_ad_t *) - (p_udf_fe->ext_attr_alloc_descs + p_udf_fe->i_extended_attr); + (p_udf_fe->u.ext_attr + p_udf_fe->i_extended_attr); *start = uint32_from_le(p_ad->ext_loc.lba); /* ignore partition number */ *end = *start + diff --git a/src/rufus.rc b/src/rufus.rc index 44c0b861..f33d2316 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 206, 278 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW -CAPTION "Rufus v1.0.7.143" +CAPTION "Rufus v1.0.7.144" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,236,50,14 @@ -70,7 +70,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP CONTROL "http://rufus.akeo.ie",IDC_ABOUT_RUFUS_URL, "SysLink",WS_TABSTOP,46,47,114,9 - LTEXT "Version 1.0.7 (Build 143)",IDC_STATIC,46,19,78,8 + LTEXT "Version 1.0.7 (Build 144)",IDC_STATIC,46,19,78,8 PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8 @@ -208,8 +208,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,7,143 - PRODUCTVERSION 1,0,7,143 + FILEVERSION 1,0,7,144 + PRODUCTVERSION 1,0,7,144 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -226,13 +226,13 @@ BEGIN BEGIN VALUE "CompanyName", "akeo.ie" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.0.7.143" + VALUE "FileVersion", "1.0.7.144" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "1.0.7.143" + VALUE "ProductVersion", "1.0.7.144" END END BLOCK "VarFileInfo"