summaryrefslogtreecommitdiff
path: root/helper
diff options
context:
space:
mode:
Diffstat (limited to 'helper')
-rw-r--r--helper/CMakeLists.txt9
-rw-r--r--helper/message-cmdline.c11
-rw-r--r--helper/message-display.c2
-rw-r--r--helper/win32-dirent.c8
-rw-r--r--helper/win32-dirent.h4
5 files changed, 22 insertions, 12 deletions
diff --git a/helper/CMakeLists.txt b/helper/CMakeLists.txt
index b26eda2..08921b4 100644
--- a/helper/CMakeLists.txt
+++ b/helper/CMakeLists.txt
@@ -11,23 +11,29 @@ include_directories (
)
add_library(string STATIC string.c)
+add_coverage (string)
GAMMU_TUNE_SHARED(string)
add_library(array STATIC array.c)
+add_coverage (array)
GAMMU_TUNE_SHARED(array)
add_library (printing STATIC printing.c)
+add_coverage (printing)
GAMMU_TUNE_SHARED(printing)
add_library (cmdline STATIC cmdline.c)
+add_coverage (cmdline)
GAMMU_TUNE_SHARED(cmdline)
target_link_libraries (cmdline printing)
add_library (memorydisplay STATIC memory-display.c)
+add_coverage (memorydisplay)
GAMMU_TUNE_SHARED(memorydisplay)
target_link_libraries (memorydisplay libGammu)
add_library (messagecmdline STATIC message-cmdline.c)
+add_coverage (messagecmdline)
GAMMU_TUNE_SHARED(messagecmdline)
target_link_libraries (messagecmdline libGammu)
target_link_libraries (messagecmdline printing)
@@ -35,6 +41,7 @@ target_link_libraries (messagecmdline string)
target_link_libraries (messagecmdline cmdline)
add_library (messagedisplay STATIC message-display.c)
+add_coverage (messagedisplay)
GAMMU_TUNE_SHARED(messagedisplay)
target_link_libraries (messagedisplay libGammu)
target_link_libraries (messagedisplay memorydisplay)
@@ -48,10 +55,12 @@ endif (LIBINTL_LIB_FOUND AND LIBINTL_LIBRARIES)
if(WIN32 AND NOT CMAKE_COMPILER_IS_MINGW AND NOT CMAKE_COMPILER_IS_CYGWIN)
add_library(win32dirent STATIC win32-dirent.c)
+ add_coverage (win32dirent)
endif(WIN32 AND NOT CMAKE_COMPILER_IS_MINGW AND NOT CMAKE_COMPILER_IS_CYGWIN)
if (NOT HAVE_STRPTIME)
add_library(strptime STATIC strptime.c)
+ add_coverage (strptime)
GAMMU_TUNE_SHARED(strptime)
target_link_libraries (strptime string)
endif (NOT HAVE_STRPTIME)
diff --git a/helper/message-cmdline.c b/helper/message-cmdline.c
index dad1234..fe65024 100644
--- a/helper/message-cmdline.c
+++ b/helper/message-cmdline.c
@@ -116,13 +116,13 @@ GSM_Error CreateMessage(GSM_Message_Type *type, GSM_MultiSMSMessage *sms, int ar
unsigned char ReplaceBuffer2 [200],ReplaceBuffer[200];
char InputBuffer [SEND_SAVE_SMS_BUFFER_SIZE/2+1];
unsigned char Buffer [GSM_MAX_MULTI_SMS][SEND_SAVE_SMS_BUFFER_SIZE];
- int chars_read = 0;
+ ssize_t chars_read = 0;
int nextlong = 0;
gboolean ReplyViaSameSMSC = FALSE;
int MaxSMS = -1;
gboolean EMS16Bit = FALSE;
int frames_num;
- int param_value;
+ ssize_t param_value;
/* Parameters required only during saving */
int Folder = 1; /*Inbox by default */
@@ -1055,7 +1055,7 @@ GSM_Error CreateMessage(GSM_Message_Type *type, GSM_MultiSMSMessage *sms, int ar
printf(_("Wrong message length (\"%s\")\n"),argv[i]);
exit(-1);
}
- printf("%d / %d\n", param_value, chars_read);
+ printf("%ld / %ld\n", (long)param_value, (long)chars_read);
if (param_value < chars_read) {
Buffer[0][param_value * 2] = 0x00;
Buffer[0][param_value * 2 + 1] = 0x00;
@@ -1092,11 +1092,12 @@ GSM_Error CreateMessage(GSM_Message_Type *type, GSM_MultiSMSMessage *sms, int ar
nextlong = 0;
break;
case 8:/* Reject duplicates ID */
- SMSInfo.ReplaceMessage = GetInt(argv[i]);
- if (SMSInfo.ReplaceMessage < 1 || SMSInfo.ReplaceMessage > 7) {
+ param_value = GetInt(argv[i]);
+ if (param_value < 1 || param_value > 7) {
printf(_("You have to give number between 1 and 7 (\"%s\")\n"),argv[i]);
exit(-1);
}
+ SMSInfo.ReplaceMessage = (unsigned char)param_value;
nextlong = 0;
break;
case 9:/* Replace file for text SMS */
diff --git a/helper/message-display.c b/helper/message-display.c
index 6a32105..00d3aca 100644
--- a/helper/message-display.c
+++ b/helper/message-display.c
@@ -418,7 +418,7 @@ void DisplayMultiSMSInfo (GSM_MultiSMSMessage *sms, gboolean eachsms, gboolean e
#if 0
/* Disabled for now */
if (answer_yes("%s", _("Do you want to play it?")))
- GSM_PlayRingtone(*SMSInfo.Entries[i].Ringtone);
+ GSM_PlayRingtone(SMSInfo.Entries[i].Ringtone);
#endif
break;
case SMS_NokiaCallerLogo:
diff --git a/helper/win32-dirent.c b/helper/win32-dirent.c
index 8fda1e5..7b7eb25 100644
--- a/helper/win32-dirent.c
+++ b/helper/win32-dirent.c
@@ -43,7 +43,7 @@ opendir ( const char *name )
int
closedir (DIR *dir)
{
- FindClose( (HANDLE)dir->dd_handle );
+ FindClose(dir->dd_handle);
free( dir );
return 0;
}
@@ -73,16 +73,16 @@ readdir( DIR *dir )
if (!dirname)
return NULL; /* Error. */
- dir->dd_handle = (long)FindFirstFile( dirname, &fInfo );
+ dir->dd_handle = FindFirstFile( dirname, &fInfo );
free( dirname );
if ( !dir->dd_handle )
ret = 0;
else
ret = 1;
}
- else if ( dir->dd_handle != -1l )
+ else if ( dir->dd_handle != INVALID_HANDLE_VALUE )
{
- ret = FindNextFile ((HANDLE)dir->dd_handle, &fInfo);
+ ret = FindNextFile (dir->dd_handle, &fInfo);
}
else
ret = 0;
diff --git a/helper/win32-dirent.h b/helper/win32-dirent.h
index 59f0dc8..d5afd5d 100644
--- a/helper/win32-dirent.h
+++ b/helper/win32-dirent.h
@@ -35,7 +35,7 @@
struct dirent {
long d_ino;
unsigned short d_reclen;
- unsigned short d_namlen;
+ size_t d_namlen;
char d_name[FILENAME_MAX];
};
@@ -43,7 +43,7 @@ typedef struct
{
struct _finddata_t dd_dta;
struct dirent dd_dir;
- long dd_handle;
+ HANDLE dd_handle;
int dd_stat;
char dd_name[1];
} DIR;