From 3ce75e4ce02e9b2ae3d02f09a94d4f16b290b37d Mon Sep 17 00:00:00 2001 From: chrfranke <chrfranke@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Fri, 12 Sep 2008 18:46:38 +0000 Subject: [PATCH] Minor changes to fix errors and warnings from Cygwin gcc 4.3.0. git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2639 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- sm5/CHANGELOG | 4 +++- sm5/atacmds.cpp | 5 +++-- sm5/ataprint.cpp | 3 ++- sm5/os_win32.cpp | 4 ++-- sm5/utility.h | 3 ++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/sm5/CHANGELOG b/sm5/CHANGELOG index 9e0161bf9..0460d7c8f 100644 --- a/sm5/CHANGELOG +++ b/sm5/CHANGELOG @@ -1,6 +1,6 @@ CHANGELOG for smartmontools -$Id: CHANGELOG,v 1.729 2008/09/06 21:11:59 chrfranke Exp $ +$Id: CHANGELOG,v 1.730 2008/09/12 18:46:38 chrfranke Exp $ The most recent version of this file is: http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup @@ -39,6 +39,8 @@ NOTES FOR FUTURE RELEASES: see TODO file. <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> + [CF] Minor changes to fix errors and warnings from Cygwin gcc 4.3.0. + [CF] smartd: Remove SCSITIMEOUT code. According to smartd.h 1.54 CVS log from 2003-10-27, it did never work. diff --git a/sm5/atacmds.cpp b/sm5/atacmds.cpp index 0b84ca6e9..e4bda4624 100644 --- a/sm5/atacmds.cpp +++ b/sm5/atacmds.cpp @@ -39,7 +39,7 @@ #include <algorithm> // std::sort -const char *atacmds_c_cvsid="$Id: atacmds.cpp,v 1.206 2008/09/06 20:08:35 chrfranke Exp $" +const char *atacmds_c_cvsid="$Id: atacmds.cpp,v 1.207 2008/09/12 18:46:38 chrfranke Exp $" ATACMDS_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID SCSIATA_H_CVSID UTILITY_H_CVSID; // for passing global control variables @@ -222,7 +222,8 @@ int parse_attribute_def(const char * pair, unsigned char * defs) char temp[32]; // look along list and see if we find the pair - for (i=0; vendorattributeargs[i] && strcmp(pair, vendorattributeargs[i]); i++); + for (i=0; vendorattributeargs[i] && strcmp(pair, vendorattributeargs[i]); i++) + ; switch (i) { case 0: diff --git a/sm5/ataprint.cpp b/sm5/ataprint.cpp index c4f52614c..997146b23 100644 --- a/sm5/ataprint.cpp +++ b/sm5/ataprint.cpp @@ -27,6 +27,7 @@ #include <ctype.h> #include <errno.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #ifdef HAVE_LOCALE_H #include <locale.h> @@ -42,7 +43,7 @@ #include "utility.h" #include "knowndrives.h" -const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.198 2008/09/06 20:08:35 chrfranke Exp $" +const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.199 2008/09/12 18:46:38 chrfranke Exp $" ATACMDNAMES_H_CVSID ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID KNOWNDRIVES_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID; // for passing global control variables diff --git a/sm5/os_win32.cpp b/sm5/os_win32.cpp index 7d97b2ff7..acaaf8ce0 100644 --- a/sm5/os_win32.cpp +++ b/sm5/os_win32.cpp @@ -48,7 +48,7 @@ extern smartmonctrl * con; // con->permissive,reportataioctl // Needed by '-V' option (CVS versioning) of smartd/smartctl -const char *os_XXXX_c_cvsid="$Id: os_win32.cpp,v 1.68 2008/08/23 17:07:16 chrfranke Exp $" +const char *os_XXXX_c_cvsid="$Id: os_win32.cpp,v 1.69 2008/09/12 18:46:38 chrfranke Exp $" ATACMDS_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID; @@ -1749,7 +1749,7 @@ union STORAGE_DEVICE_DESCRIPTOR_DATA { static int storage_query_property_ioctl(HANDLE hdevice, STORAGE_DEVICE_DESCRIPTOR_DATA * data) { - STORAGE_PROPERTY_QUERY query = {StorageDeviceProperty, PropertyStandardQuery, 0}; + STORAGE_PROPERTY_QUERY query = {StorageDeviceProperty, PropertyStandardQuery, {0} }; memset(data, 0, sizeof(*data)); DWORD num_out; diff --git a/sm5/utility.h b/sm5/utility.h index 845cea504..09f46e5b8 100644 --- a/sm5/utility.h +++ b/sm5/utility.h @@ -25,12 +25,13 @@ #ifndef UTILITY_H_ #define UTILITY_H_ -#define UTILITY_H_CVSID "$Id: utility.h,v 1.62 2008/09/06 14:37:18 chrfranke Exp $\n" +#define UTILITY_H_CVSID "$Id: utility.h,v 1.63 2008/09/12 18:46:38 chrfranke Exp $\n" #include <time.h> #include <sys/types.h> // for regex.h (according to POSIX) #include <regex.h> #include <stdarg.h> +#include <string.h> #include <string> #if !defined(__GNUC__) && !defined(__attribute__) -- GitLab