From 6275c5b724e2ccbdc14460201fa17767ddde79e6 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 3 Sep 2018 13:41:29 +0100 Subject: [PATCH] fix MinGW-w64 warnings --- configure | 2 +- configure.ac | 2 +- src/format.c | 2 +- src/libcdio/cdio/xa.h | 4 +--- src/libcdio/iso9660/iso9660.c | 3 +-- src/libcdio/iso9660/iso9660_fs.c | 4 ++-- src/rufus.rc | 10 +++++----- 7 files changed, 12 insertions(+), 15 deletions(-) diff --git a/configure b/configure index ff2b26b6..e6ac71ef 100755 --- a/configure +++ b/configure @@ -3894,7 +3894,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="${saved_CFLAGS}" -AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -std=gnu99 -Wshadow -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags" +AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -std=gnu99 -Wshadow -Wall -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Werror-implicit-function-declaration $nopointersign_cflags" diff --git a/configure.ac b/configure.ac index 5333552f..bd668bf2 100644 --- a/configure.ac +++ b/configure.ac @@ -62,7 +62,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [nopointersign_cflags="-Wno-pointer-sign"], [nopointersign_cflags=""]) CFLAGS="${saved_CFLAGS}" -AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -std=gnu99 -Wshadow -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags" +AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -std=gnu99 -Wshadow -Wall -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Werror-implicit-function-declaration $nopointersign_cflags" AC_SUBST([VISIBILITY_CFLAGS]) AC_SUBST([AM_CFLAGS]) diff --git a/src/format.c b/src/format.c index 8ca21ec9..cbc4baf2 100644 --- a/src/format.c +++ b/src/format.c @@ -479,7 +479,7 @@ static BOOL FormatFAT32(DWORD DriveIndex) pFAT32BootSect->sJmpBoot[0]=0xEB; pFAT32BootSect->sJmpBoot[1]=0x58; // jmp.s $+0x5a is 0xeb 0x58, not 0xeb 0x5a. Thanks Marco! pFAT32BootSect->sJmpBoot[2]=0x90; - strncpy((char*)pFAT32BootSect->sOEMName, "MSWIN4.1", 8); + memcpy(pFAT32BootSect->sOEMName, "MSWIN4.1", 8); pFAT32BootSect->wBytsPerSec = (WORD) BytesPerSect; ClusterSize = (DWORD)ComboBox_GetItemData(hClusterSize, ComboBox_GetCurSel(hClusterSize)); diff --git a/src/libcdio/cdio/xa.h b/src/libcdio/cdio/xa.h index c9e091f0..32e9f5ec 100644 --- a/src/libcdio/cdio/xa.h +++ b/src/libcdio/cdio/xa.h @@ -71,9 +71,7 @@ extern "C" { XA_FORM2_FILE = (XA_ATTR_MODE2FORM2 | XA_PERM_ALL_ALL) } xa_misc_enum_t; -extern const char ISO_XA_MARKER_STRING[sizeof("CD-XA001")-1]; - -#define ISO_XA_MARKER_STRING "CD-XA001" +extern const char ISO_XA_MARKER_STRING[8]; /*! \brief "Extended Architecture" according to the Philips Yellow Book. diff --git a/src/libcdio/iso9660/iso9660.c b/src/libcdio/iso9660/iso9660.c index 7c55358a..689aa5bb 100644 --- a/src/libcdio/iso9660/iso9660.c +++ b/src/libcdio/iso9660/iso9660.c @@ -632,8 +632,7 @@ iso9660_set_pvd(void *pd, memset(&ipd,0,sizeof(ipd)); /* paranoia? */ /* magic stuff ... thatis CD XA marker... */ - strncpy(((char*)&ipd)+ISO_XA_MARKER_OFFSET, ISO_XA_MARKER_STRING, - sizeof(ISO_XA_MARKER_STRING)); + strncpy(((char*)&ipd)+ISO_XA_MARKER_OFFSET, ISO_XA_MARKER_STRING,8); ipd.type = to_711(ISO_VD_PRIMARY); iso9660_strncpy_pad (ipd.id, ISO_STANDARD_ID, 5, ISO9660_DCHARS); diff --git a/src/libcdio/iso9660/iso9660_fs.c b/src/libcdio/iso9660/iso9660_fs.c index 4e6c31ff..f2e17107 100644 --- a/src/libcdio/iso9660/iso9660_fs.c +++ b/src/libcdio/iso9660/iso9660_fs.c @@ -850,9 +850,9 @@ _iso9660_dir_to_statbuf (iso9660_dir_t *p_iso9660_dir, strncpy(p_stat->filename, rr_fname, i_rr_fname+1); } else { if ('\0' == p_iso9660_dir->filename.str[1] && 1 == i_fname) - strncpy (p_stat->filename, ".", sizeof(".")); + strncpy (p_stat->filename, ".", 2); else if ('\1' == p_iso9660_dir->filename.str[1] && 1 == i_fname) - strncpy (p_stat->filename, "..", sizeof("..")); + strncpy (p_stat->filename, "..", 3); #ifdef HAVE_JOLIET else if (u_joliet_level) { int i_inlen = i_fname; diff --git a/src/rufus.rc b/src/rufus.rc index f37f6bf4..e964b30d 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 232, 326 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 3.2.1388" +CAPTION "Rufus 3.2.1389" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -392,8 +392,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,2,1388,0 - PRODUCTVERSION 3,2,1388,0 + FILEVERSION 3,2,1389,0 + PRODUCTVERSION 3,2,1389,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -411,13 +411,13 @@ BEGIN VALUE "Comments", "https://akeo.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.2.1388" + VALUE "FileVersion", "3.2.1389" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus-3.2.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.2.1388" + VALUE "ProductVersion", "3.2.1389" END END BLOCK "VarFileInfo"