Fix ICC warnings
authorRoland Schulz <roland@utk.edu>
Thu, 11 Sep 2014 01:08:59 +0000 (21:08 -0400)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 23 Sep 2014 13:50:41 +0000 (15:50 +0200)
- 111: statement is unreachable
- 181: printf/scanf argument type invalid

Change-Id: I28477bdd5734f34ae4deed09b9cddce922469f81

19 files changed:
cmake/gmxCFlags.cmake
src/external/thread_mpi/src/pthreads.c
src/external/tng_io/include/tng/tng_io.h
src/external/tng_io/src/lib/tng_io.c
src/gromacs/fft/fft5d.cpp
src/gromacs/fileio/gmxfio_asc.c
src/gromacs/fileio/libxdrf.c
src/gromacs/fileio/pdbio.c
src/gromacs/gmxana/gmx_confrms.c
src/gromacs/gmxana/gmx_editconf.c
src/gromacs/gmxana/gmx_hbond.c
src/gromacs/gmxana/gmx_sham.c
src/gromacs/gmxana/gmx_trjconv.c
src/gromacs/gmxlib/txtdump.c
src/gromacs/gmxpreprocess/topio.c
src/gromacs/gmxpreprocess/vsite_parm.c
src/gromacs/mdlib/shakef.c
src/gromacs/pbcutil/mshift.cpp
src/gromacs/tools/compare.c

index 1e675f72f706353d58fd6eb7cf7901bc1f67e283..011cada36e16dfdbe6eb9008041156c85e4c070d 100644 (file)
@@ -148,9 +148,7 @@ MACRO(gmx_c_flags)
                     GMX_TEST_CFLAG(CFLAGS_PRAGMA "-wd161" GMXC_CFLAGS)
                 endif()
             endif()
-# 111: statement is unreachable
-# 177: function ".." was declared but never referenced
-# 181: argument of type ".." is incompatible with format "..", expecting argument of type ".."
+# 177: function/variable ".." was declared but never referenced
 # 193: zero used for undefined preprocessing identifier ".."
 # 271: trailing comma is nonstandard
 # 304: access control not specified ("public" by default)
@@ -173,7 +171,7 @@ MACRO(gmx_c_flags)
 #3346: dynamic exception specifications are deprecated
 #11074: Inlining inhibited by limit max-size(/max-total-size)
 #11076: To get full report use -opt-report=3 -opt-report-phase ipo (shown for previous remark)
-            GMX_TEST_CFLAG(CFLAGS_WARN "-w3 -wd111 -wd177 -wd181 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd11074 -wd11076" GMXC_CFLAGS)
+            GMX_TEST_CFLAG(CFLAGS_WARN "-w3 -wd177 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd11074 -wd11076" GMXC_CFLAGS)
             GMX_TEST_CFLAG(CFLAGS_STDGNU "-std=gnu99" GMXC_CFLAGS)
             GMX_TEST_CFLAG(CFLAGS_OPT "-ip -funroll-all-loops -alias-const -ansi-alias" GMXC_CFLAGS_RELEASE)
         else()
@@ -184,7 +182,7 @@ MACRO(gmx_c_flags)
                     GMX_TEST_CFLAG(CFLAGS_PRAGMA "/wd161" GMXC_CFLAGS)
                 endif()
             endif()
-            GMX_TEST_CFLAG(CFLAGS_WARN "/W3 /wd111 /wd177 /wd181 /wd193 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346" GMXC_CFLAGS)
+            GMX_TEST_CFLAG(CFLAGS_WARN "/W3 /wd177 /wd193 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346" GMXC_CFLAGS)
             GMX_TEST_CFLAG(CFLAGS_OPT "/Qip" GMXC_CFLAGS_RELEASE)
         endif()
     endif()
@@ -201,7 +199,7 @@ MACRO(gmx_c_flags)
 #All but the following warnings are identical for the C-compiler (see above)
 #1782: #pragma once is obsolete
 #2282: unrecognized GCC pragma
-            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3 -wd111 -wd177 -wd181 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd11074 -wd11076 -wd1782 -wd2282" GMXC_CXXFLAGS)
+            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3 -wd177 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd11074 -wd11076 -wd1782 -wd2282" GMXC_CXXFLAGS)
             GMX_TEST_CXXFLAG(CXXFLAGS_OPT "-ip -funroll-all-loops -alias-const -ansi-alias" GMXC_CXXFLAGS_RELEASE)
         else()
             if(NOT GMX_OPENMP)
@@ -211,7 +209,7 @@ MACRO(gmx_c_flags)
                     GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "/wd161" GMXC_CXXFLAGS)
                 endif()
             endif()
-            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/W3 /wd111 /wd177 /wd181 /wd193 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346 /wd1782 /wd2282" GMXC_CXXFLAGS)
+            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/W3 /wd177 /wd193 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346 /wd1782 /wd2282" GMXC_CXXFLAGS)
             GMX_TEST_CXXFLAG(CXXFLAGS_OPT "/Qip" GMXC_CXXFLAGS_RELEASE)
         endif()
     endif()
index 3aee9c52e55c20a7520784c136a51c23ccb128c8..0c34919e7516cdd8a9123eb7d7ac3e1b06686843 100644 (file)
@@ -372,8 +372,9 @@ int tMPI_Thread_setaffinity_single(tMPI_Thread_t tmpi_unused thread,
     CPU_ZERO(&set);
     CPU_SET(nr, &set);
     return pthread_setaffinity_np(thread->th, sizeof(set), &set);
-#endif
+#else
     return 0;
+#endif
 }
 
 
index 51c1d9b5935f89fa64dc6c2f78c020b21b2157cd..c607aad2c5d9849e4c66217a988903b664ed5ecb 100644 (file)
@@ -331,6 +331,9 @@ typedef unsigned __int64 uint64_t;
 #ifndef PRId64
 # define PRId64         __PRI64_PREFIX "d"
 #endif
+#ifndef PRIu64
+# define PRIu64         __PRI64_PREFIX "u"
+#endif
 
 #endif
 
index 074b781317ebdc50c78b2455d25d9462affbe095..7702d23846c5d12cd5aa2351c0a7a4fe2a4f193e 100644 (file)
@@ -3222,7 +3222,7 @@ static tng_function_status tng_molecules_block_read
                           sizeof(struct tng_molecule));
     if(!tng_data->molecules)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                tng_data->n_molecules * sizeof(struct tng_molecule),
                __FILE__, __LINE__);
         return(TNG_CRITICAL);
@@ -3238,7 +3238,7 @@ static tng_function_status tng_molecules_block_read
                                       tng_data->n_molecules);
         if(!tng_data->molecule_cnt_list)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                    tng_data->n_molecules * sizeof(struct tng_molecule),
                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
@@ -3354,7 +3354,7 @@ static tng_function_status tng_molecules_block_read
                                     sizeof(struct tng_chain));
             if(!molecule->chains)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                     molecule->n_chains * sizeof(struct tng_chain),
                     __FILE__, __LINE__);
                 return(TNG_CRITICAL);
@@ -3373,7 +3373,7 @@ static tng_function_status tng_molecules_block_read
                                 sizeof(struct tng_residue));
             if(!molecule->residues)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                     molecule->n_residues * sizeof(struct tng_residue),
                     __FILE__, __LINE__);
                 if(molecule->chains)
@@ -3395,7 +3395,7 @@ static tng_function_status tng_molecules_block_read
                                  sizeof(struct tng_atom));
         if(!molecule->atoms)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                    molecule->n_atoms * sizeof(struct tng_atom),
                    __FILE__, __LINE__);
             if(molecule->chains)
@@ -3503,7 +3503,7 @@ static tng_function_status tng_molecules_block_read
                                            sizeof(struct tng_bond));
             if(!molecule->bonds)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                        molecule->n_bonds * sizeof(struct tng_bond),
                        __FILE__, __LINE__);
                 if(molecule->chains)
@@ -3997,7 +3997,7 @@ static tng_function_status tng_frame_set_block_read
 
                 if(!frame_set->molecule_cnt_list)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                            sizeof(int64_t) * tng_data->n_molecules,
                            __FILE__, __LINE__);
                     return(TNG_CRITICAL);
@@ -4199,7 +4199,7 @@ static tng_function_status tng_frame_set_block_write
         temp_name = realloc(block->name, name_len + 1);
         if(!temp_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%u bytes). %s: %d\n",
                    name_len+1, __FILE__, __LINE__);
             free(block->name);
             block->name = 0;
@@ -4538,7 +4538,7 @@ static tng_function_status tng_trajectory_mapping_block_read
                                             sizeof(int64_t));
     if(!mapping->real_particle_numbers)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                 mapping->n_particles * sizeof(int64_t), __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
@@ -4614,7 +4614,7 @@ static tng_function_status tng_trajectory_mapping_block_write
         temp_name = realloc(block->name, name_len + 1);
         if(!temp_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%u bytes). %s: %d\n",
                    name_len+1, __FILE__, __LINE__);
             free(block->name);
             block->name = 0;
@@ -5190,7 +5190,7 @@ static tng_function_status tng_gzip_compress(tng_trajectory_t tng_data,
     dest = malloc(max_len);
     if(!dest)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%ld bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%lu bytes). %s: %d\n",
                max_len, __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
@@ -5365,7 +5365,7 @@ static tng_function_status tng_allocate_particle_data_mem
                                     n_particles);
             if(!data->strings[i])
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                     sizeof(union data_values *) * n_particles,
                     __FILE__, __LINE__);
                 return(TNG_CRITICAL);
@@ -5376,7 +5376,7 @@ static tng_function_status tng_allocate_particle_data_mem
                                             n_values_per_frame);
                 if(!data->strings[i][j])
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                         sizeof(union data_values) * n_values_per_frame,
                         __FILE__, __LINE__);
                     return(TNG_CRITICAL);
@@ -6907,7 +6907,7 @@ static tng_function_status tng_data_block_write(tng_trajectory_t tng_data,
         temp_name = realloc(block->name, len);
         if(!temp_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n", len+1,
+            fprintf(stderr, "TNG library: Cannot allocate memory (%u bytes). %s: %d\n", len+1,
                    __FILE__, __LINE__);
             free(block->name);
             block->name = 0;
@@ -8009,7 +8009,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_w_id_add
 
     if(!new_molecules)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_molecule) * (tng_data->n_molecules + 1),
                __FILE__, __LINE__);
         free(tng_data->molecules);
@@ -8023,7 +8023,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_w_id_add
 
     if(!new_molecule_cnt_list)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(int64_t) * (tng_data->n_molecules + 1),
                __FILE__, __LINE__);
         free(tng_data->molecule_cnt_list);
@@ -8075,7 +8075,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_existing_add
 
     if(!new_molecules)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_molecule) * (tng_data->n_molecules + 1),
                __FILE__, __LINE__);
         free(tng_data->molecules);
@@ -8089,7 +8089,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_existing_add
 
     if(!new_molecule_cnt_list)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(int64_t) * (tng_data->n_molecules + 1),
                __FILE__, __LINE__);
         free(tng_data->molecule_cnt_list);
@@ -8320,7 +8320,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_system_copy(tng_trajectory_t
                     sizeof(struct tng_molecule) * tng_data_src->n_molecules);
     if(!molecule_temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_molecule) * tng_data_src->n_molecules,
                __FILE__, __LINE__);
         free(tng_data_dest->molecules);
@@ -8331,7 +8331,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_system_copy(tng_trajectory_t
                                      sizeof(int64_t) * tng_data_src->n_molecules);
     if(!list_temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(int64_t) * tng_data_src->n_molecules,
                __FILE__, __LINE__);
         free(tng_data_dest->molecule_cnt_list);
@@ -8401,7 +8401,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_system_copy(tng_trajectory_t
                                 molecule->n_bonds);
             if(!bond_temp)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                        sizeof(struct tng_bond) * molecule->n_bonds,
                        __FILE__, __LINE__);
                 free(molecule_temp->bonds);
@@ -8601,7 +8601,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_w_id_add
 
     if(!new_chains)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_chain) * (molecule->n_chains + 1),
                __FILE__, __LINE__);
         free(molecule->chains);
@@ -8642,7 +8642,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_bond_add
 
     if(!new_bonds)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_bond) * (molecule->n_bonds + 1),
                __FILE__, __LINE__);
         *bond = 0;
@@ -8867,7 +8867,7 @@ tng_function_status DECLSPECDLLEXPORT tng_chain_residue_w_id_add
 
     if(!new_residues)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_residue) * (molecule->n_residues + 1),
                __FILE__, __LINE__);
         free(molecule->residues);
@@ -9079,7 +9079,7 @@ tng_function_status DECLSPECDLLEXPORT tng_residue_atom_w_id_add
 
     if(!new_atoms)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_atom) * (molecule->n_atoms + 1),
                __FILE__, __LINE__);
         free(molecule->atoms);
@@ -9343,14 +9343,14 @@ tng_function_status DECLSPECDLLEXPORT tng_molsystem_bonds_get
     *from_atoms = malloc(sizeof(int64_t) * (*n_bonds));
     if(!*from_atoms)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(int64_t) * (*n_bonds), __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
     *to_atoms = malloc(sizeof(int64_t) * (*n_bonds));
     if(!*to_atoms)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(int64_t) * (*n_bonds), __FILE__, __LINE__);
         free(*from_atoms);
         *from_atoms = 0;
@@ -9732,7 +9732,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_mapping_add
 
     if(!mapping)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_particle_mapping)*frame_set->n_mapping_blocks,
                __FILE__, __LINE__);
         free(frame_set->mappings);
@@ -9747,7 +9747,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_mapping_add
     frame_set->mappings[frame_set->n_mapping_blocks - 1].real_particle_numbers = malloc(sizeof(int64_t) * n_particles);
     if(!frame_set->mappings[frame_set->n_mapping_blocks - 1].real_particle_numbers)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(int64_t) * n_particles, __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
@@ -15113,7 +15113,7 @@ static tng_function_status tng_data_values_alloc
     *values = malloc(sizeof(union data_values *) * n_frames);
     if(!*values)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(union data_values **) * n_frames,
                __FILE__, __LINE__);
         return(TNG_CRITICAL);
@@ -15126,7 +15126,7 @@ static tng_function_status tng_data_values_alloc
                            n_values_per_frame);
         if(!(*values)[i])
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                    sizeof(union data_values) * n_values_per_frame,
                    __FILE__, __LINE__);
             free(values);
@@ -15207,7 +15207,7 @@ static tng_function_status tng_particle_data_values_alloc
     *values = malloc(sizeof(union data_values **) * n_frames);
     if(!*values)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(union data_values **) * n_frames,
                __FILE__, __LINE__);
         return(TNG_CRITICAL);
@@ -15220,7 +15220,7 @@ static tng_function_status tng_particle_data_values_alloc
                            n_particles);
         if(!(*values)[i])
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                    sizeof(union data_values *) * n_particles,
                    __FILE__, __LINE__);
             free(*values);
@@ -15233,7 +15233,7 @@ static tng_function_status tng_particle_data_values_alloc
                                   n_values_per_frame);
             if(!(*values)[i][j])
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                     sizeof(union data_values *) * n_particles,
                     __FILE__, __LINE__);
                 tng_particle_data_values_free(tng_data, *values, n_frames,
@@ -19163,7 +19163,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat
         temp = realloc(*data_block_ids_in_next_frame, size);
         if(!temp)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                     sizeof(int64_t) * (*n_data_blocks_in_next_frame),
                     __FILE__, __LINE__);
             free(*data_block_ids_in_next_frame);
@@ -19305,7 +19305,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat
                 temp = realloc(*data_block_ids_in_next_frame, size);
                 if(!temp)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                            sizeof(int64_t) * (*n_data_blocks_in_next_frame),
                            __FILE__, __LINE__);
                     free(*data_block_ids_in_next_frame);
@@ -19392,7 +19392,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat
                 temp = realloc(*data_block_ids_in_next_frame, size);
                 if(!temp)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                            sizeof(int64_t) * (*n_data_blocks_in_next_frame),
                            __FILE__, __LINE__);
                     free(*data_block_ids_in_next_frame);
index d22662291698cee874c6e2ef6788e27e25b609cd..93f518a85b680b9303b3a2ef236882474acebd7e 100644 (file)
@@ -1005,7 +1005,7 @@ void fft5d_execute(fft5d_plan plan, int thread, fft5d_time times)
     s = 0;
 
     /*lin: x,y,z*/
-    if (plan->flags&FFT5D_DEBUG && thread == 0)
+    if ((plan->flags&FFT5D_DEBUG) && thread == 0)
     {
         print_localdata(lin, "%d %d: copy in lin\n", s, plan);
     }
@@ -1065,7 +1065,7 @@ void fft5d_execute(fft5d_plan plan, int thread, fft5d_time times)
             time_fft += MPI_Wtime()-time;
         }
 #endif
-        if (plan->flags&FFT5D_DEBUG && thread == 0)
+        if ((plan->flags&FFT5D_DEBUG) && thread == 0)
         {
             print_localdata(lout, "%d %d: FFT %d\n", s, plan);
         }
@@ -1186,7 +1186,7 @@ void fft5d_execute(fft5d_plan plan, int thread, fft5d_time times)
             time_local += MPI_Wtime()-time;
         }
 #endif
-        if (plan->flags&FFT5D_DEBUG && thread == 0)
+        if ((plan->flags&FFT5D_DEBUG) && thread == 0)
         {
             print_localdata(lin, "%d %d: tranposed %d\n", s+1, plan);
         }
@@ -1230,7 +1230,7 @@ void fft5d_execute(fft5d_plan plan, int thread, fft5d_time times)
     }
 #endif
 
-    if (plan->flags&FFT5D_DEBUG && thread == 0)
+    if ((plan->flags&FFT5D_DEBUG) && thread == 0)
     {
         print_localdata(lout, "%d %d: FFT %d\n", s, plan);
     }
index 153e345726ea88667aa6d80022eea5efd1e6160c..f819a8d7a0a25c2a6199ce73f4cffe80e0799680 100644 (file)
@@ -293,8 +293,9 @@ static gmx_bool do_ascread(t_fileio *fio, void *item, int nitem, int eio,
     int             i, m, res = 0, *iptr, ix;
     gmx_int64_t     s;
     double          d, x;
+    char            c;
     real           *ptr;
-    unsigned char   uc, *ucptr;
+    unsigned char  *ucptr;
     char           *cptr;
 #define NEXT_ITEM_BUF_LEN 128
     char            ni_buf[NEXT_ITEM_BUF_LEN];
@@ -327,10 +328,10 @@ static gmx_bool do_ascread(t_fileio *fio, void *item, int nitem, int eio,
             }
             break;
         case eioUCHAR:
-            res = sscanf(next_item(fp, ni_buf, NEXT_ITEM_BUF_LEN), "%c", &uc);
+            res = sscanf(next_item(fp, ni_buf, NEXT_ITEM_BUF_LEN), "%c", &c);
             if (item)
             {
-                *((unsigned char *) item) = uc;
+                *((unsigned char *) item) = (unsigned char)c;
             }
             break;
         case eioNUCHAR:
index 90e58d4ee251c740b9281b023a106ac9b24e326c..401cfa8883691e9731e56380661d4c906068ed56 100644 (file)
@@ -1130,7 +1130,6 @@ xtc_get_next_frame_number(FILE *fp, XDR *xdrs, int natoms)
             }
         }
     }
-    return -1;
 }
 
 
@@ -1171,7 +1170,6 @@ static float xtc_get_next_frame_time(FILE *fp, XDR *xdrs, int natoms,
             return -1;
         }
     }
-    return -1;
 }
 
 
@@ -1219,7 +1217,6 @@ xtc_get_current_frame_time(FILE *fp, XDR *xdrs, int natoms, gmx_bool * bOK)
             }
         }
     }
-    return -1;
 }
 
 /* Currently not used, just for completeness */
@@ -1269,7 +1266,6 @@ xtc_get_current_frame_number(FILE *fp, XDR *xdrs, int natoms, gmx_bool * bOK)
             }
         }
     }
-    return -1;
 }
 
 
@@ -1302,7 +1298,6 @@ static gmx_off_t xtc_get_next_frame_start(FILE *fp, XDR *xdrs, int natoms)
             return -1;
         }
     }
-    return -1;
 }
 
 
index d5b8a00517490597e4026700b86545834708fff4..20bd556dae66b0e680a567c5c0de966aa9c40076 100644 (file)
@@ -392,7 +392,7 @@ void write_pdbfile_indexed(FILE *out, const char *title,
 
         if (atoms->pdbinfo && atoms->pdbinfo[i].bAnisotropic)
         {
-            fprintf(out, "ANISOU%5u  %-4.4s%4.4s%c%4d%c %7d%7d%7d%7d%7d%7d\n",
+            fprintf(out, "ANISOU%5d  %-4.4s%4.4s%c%4d%c %7d%7d%7d%7d%7d%7d\n",
                     (i+1)%100000, nm, resnm, ch, resnr,
                     (resic == '\0') ? ' ' : resic,
                     atoms->pdbinfo[i].uij[0], atoms->pdbinfo[i].uij[1],
index 3cc6dc6d14b295a6b1129f87b88ad892af016228..af82b05a04cf358f4ce7b14009089984f1d035c2 100644 (file)
@@ -611,12 +611,12 @@ int gmx_confrms(int argc, char *argv[])
             fprintf(fp, "[ Match_%s_%s ]\n", conf1file, groupnames1);
             for (i = 0; i < isize1; i++)
             {
-                fprintf(fp, "%4u%s", index1[i]+1, (i%15 == 14 || i == isize1-1) ? "\n" : " ");
+                fprintf(fp, "%4d%s", index1[i]+1, (i%15 == 14 || i == isize1-1) ? "\n" : " ");
             }
             fprintf(fp, "[ Match_%s_%s ]\n", conf2file, groupnames2);
             for (i = 0; i < isize2; i++)
             {
-                fprintf(fp, "%4u%s", index2[i]+1, (i%15 == 14 || i == isize2-1) ? "\n" : " ");
+                fprintf(fp, "%4d%s", index2[i]+1, (i%15 == 14 || i == isize2-1) ? "\n" : " ");
             }
         }
     }
@@ -636,7 +636,7 @@ int gmx_confrms(int argc, char *argv[])
             if (warn < 20)
             {
                 fprintf(stderr,
-                        "Warning: atomnames at index %d don't match: %u %s, %u %s\n",
+                        "Warning: atomnames at index %d don't match: %d %s, %d %s\n",
                         i+1, index1[i]+1, name1, index2[i]+1, name2);
             }
             warn++;
index 02069c9945bc1408e8716b7724899fa341416125..9fedfee2c8bf6f8acfffb17303869d4758ff00c9 100644 (file)
@@ -340,7 +340,7 @@ void pdb_legend(FILE *out, int natoms, int nres, t_atoms *atoms, rvec x[])
     for (i = 1; (i < 12); i++)
     {
         fprintf(out,
-                "%-6s%5u  %-4.4s%3.3s %c%4d%c   %8.3f%8.3f%8.3f%6.2f%6.2f\n",
+                "%-6s%5d  %-4.4s%3.3s %c%4d%c   %8.3f%8.3f%8.3f%6.2f%6.2f\n",
                 "ATOM  ", natoms + 1 + i, "CA", "LEG", space, nres + 1, space,
                 (xmin + (i * 0.12)) * 10, ymin * 10, zmin * 10, 1.0, bfac_min
                 + ((i - 1.0) * (bfac_max - bfac_min) / 10));
index 06911ed582214ded1cc8209f72bbfe11e3a569bb..5d960071a7e80b64503180e44fe66f79180081b9 100644 (file)
@@ -3386,7 +3386,7 @@ static void dump_hbmap(t_hbdata *hb,
         for (i = 0; i < isize[grp]; i++)
         {
             fprintf(fp, (i%15) ? " " : "\n");
-            fprintf(fp, " %4u", index[grp][i]+1);
+            fprintf(fp, " %4d", index[grp][i]+1);
         }
         fprintf(fp, "\n");
         /*
@@ -3402,7 +3402,7 @@ static void dump_hbmap(t_hbdata *hb,
                 {
                     for (j = 0; (j < hb->d.nhydro[i]); j++)
                     {
-                        fprintf(fp, " %4u %4u", hb->d.don[i]+1,
+                        fprintf(fp, " %4d %4d", hb->d.don[i]+1,
                                 hb->d.hydro[i][j]+1);
                     }
                     fprintf(fp, "\n");
@@ -3415,7 +3415,7 @@ static void dump_hbmap(t_hbdata *hb,
                 if (hb->a.grp[i] == grp)
                 {
                     fprintf(fp, (i%15 && !first) ? " " : "\n");
-                    fprintf(fp, " %4u", hb->a.acc[i]+1);
+                    fprintf(fp, " %4d", hb->a.acc[i]+1);
                     first = FALSE;
                 }
             }
@@ -3446,7 +3446,7 @@ static void dump_hbmap(t_hbdata *hb,
                     sprintf(as, "%s", mkatomname(atoms, aaa));
                     if (bContact)
                     {
-                        fprintf(fp, " %6u %6u\n", ddd+1, aaa+1);
+                        fprintf(fp, " %6d %6d\n", ddd+1, aaa+1);
                         if (fplog)
                         {
                             fprintf(fplog, "%12s  %12s\n", ds, as);
@@ -3456,7 +3456,7 @@ static void dump_hbmap(t_hbdata *hb,
                     {
                         hhh = hb->d.hydro[i][m];
                         sprintf(hs, "%s", mkatomname(atoms, hhh));
-                        fprintf(fp, " %6u %6u %6u\n", ddd+1, hhh+1, aaa+1);
+                        fprintf(fp, " %6d %6d %6d\n", ddd+1, hhh+1, aaa+1);
                         if (fplog)
                         {
                             fprintf(fplog, "%12s  %12s  %12s\n", ds, hs, as);
index 863e820489311dce7ea8895d4dcc76ca563e3551..94430c03d99c08292de5282428e335bc8ab5c6f8 100644 (file)
@@ -756,7 +756,7 @@ static void do_sham(const char *fn, const char *ndx,
                     index   = index3(ibox, i, j, k);
                     if (P[index] > 0)
                     {
-                        fprintf(fp, "%-6s%5u  %-4.4s%3.3s  %4d    %8.3f%8.3f%8.3f%6.2f%6.2f\n",
+                        fprintf(fp, "%-6s%5d  %-4.4s%3.3s  %4d    %8.3f%8.3f%8.3f%6.2f%6.2f\n",
                                 "ATOM", (index+1) %10000, "H", "H", (index+1)%10000,
                                 xxx[XX], xxx[YY], xxx[ZZ], 1.0, W[index]);
                     }
index 4a0be116817ffac64439101c149293314751277f..b687c07220f416257e73a780d5ae5c2c8424a199 100644 (file)
@@ -376,7 +376,7 @@ static void put_residue_com_in_box(int unitcell_enum, int ecenter,
             {
                 if (debug)
                 {
-                    fprintf(debug, "\nShifting position of residue %d (atoms %u-%u) "
+                    fprintf(debug, "\nShifting position of residue %d (atoms %d-%d) "
                             "by %g,%g,%g\n", atom[res_start].resind+1,
                             res_start+1, res_end+1, shift[XX], shift[YY], shift[ZZ]);
                 }
index 9b3eec687ef43eeecb59054f67c906161f2a8559..a70c1c005c5921f050fbca682919b295ce704b7b 100644 (file)
@@ -1411,7 +1411,7 @@ void pr_ilist(FILE *fp, int indent, const char *title,
                 j++;
                 for (k = 0; k < interaction_function[ftype].nratoms; k++)
                 {
-                    (void) fprintf(fp, " %u", *(iatoms++));
+                    (void) fprintf(fp, " %d", *(iatoms++));
                 }
                 (void) fprintf(fp, "\n");
                 i += 1+interaction_function[ftype].nratoms;
index ffc95d0596abccbe26cf93d5b5516d1fd1b3e8a4..e09518e8b270c2fc12fb6c2f1d9a3aa7bfb138b6 100644 (file)
@@ -995,7 +995,7 @@ static char **read_topol(const char *infile, const char *outfile,
                             break;
                         }
                         default:
-                            fprintf (stderr, "case: %d\n", d);
+                            fprintf (stderr, "case: %d\n", (int)d);
                             gmx_incons("unknown directive");
                     }
                 }
index df9f9160ad7d99b88d00ead8463d296e1a9f796a..5a1088711a9db6a80d32897c242eebf8ffdcbf9a 100644 (file)
@@ -289,7 +289,7 @@ static void print_bad(FILE *fp,
         fprintf(fp, "bonds:");
         for (i = 0; i < nrbond; i++)
         {
-            fprintf(fp, " %u-%u (%g)",
+            fprintf(fp, " %d-%d (%g)",
                     bonds[i].AI+1, bonds[i].AJ+1, bonds[i].c);
         }
         fprintf(fp, "\n");
@@ -299,7 +299,7 @@ static void print_bad(FILE *fp,
         fprintf(fp, "angles:");
         for (i = 0; i < nrang; i++)
         {
-            fprintf(fp, " %u-%u-%u (%g)",
+            fprintf(fp, " %d-%d-%d (%g)",
                     angles[i].AI+1, angles[i].AJ+1,
                     angles[i].AK+1, angles[i].c);
         }
@@ -310,7 +310,7 @@ static void print_bad(FILE *fp,
         fprintf(fp, "idihs:");
         for (i = 0; i < nridih; i++)
         {
-            fprintf(fp, " %u-%u-%u-%u (%g)",
+            fprintf(fp, " %d-%d-%d-%d (%g)",
                     idihs[i].AI+1, idihs[i].AJ+1,
                     idihs[i].AK+1, idihs[i].AL+1, idihs[i].c);
         }
@@ -422,7 +422,7 @@ static gmx_bool calc_vsite3_param(gpp_atomtype_t atype,
         int i;
         for (i = 0; i < 4; i++)
         {
-            fprintf(debug, "atom %u type %s ",
+            fprintf(debug, "atom %d type %s ",
                     param->a[i]+1,
                     get_atomtype_name_AB(&at->atom[param->a[i]], atype));
         }
@@ -493,7 +493,7 @@ static gmx_bool calc_vsite3_param(gpp_atomtype_t atype,
 
     if (debug)
     {
-        fprintf(debug, "params for vsite3 %u: %g %g\n",
+        fprintf(debug, "params for vsite3 %d: %g %g\n",
                 param->AI+1, param->C0, param->C1);
     }
 
@@ -527,7 +527,7 @@ static gmx_bool calc_vsite3fd_param(t_param *param,
 
     if (debug)
     {
-        fprintf(debug, "params for vsite3fd %u: %g %g\n",
+        fprintf(debug, "params for vsite3fd %d: %g %g\n",
                 param->AI+1, param->C0, param->C1);
     }
     return bError;
@@ -562,7 +562,7 @@ static gmx_bool calc_vsite3fad_param(t_param *param,
 
     if (debug)
     {
-        fprintf(debug, "params for vsite3fad %u: %g %g\n",
+        fprintf(debug, "params for vsite3fad %d: %g %g\n",
                 param->AI+1, param->C0, param->C1);
     }
     return bError;
@@ -589,7 +589,7 @@ static gmx_bool calc_vsite3out_param(gpp_atomtype_t atype,
         int i;
         for (i = 0; i < 4; i++)
         {
-            fprintf(debug, "atom %u type %s ",
+            fprintf(debug, "atom %d type %s ",
                     param->a[i]+1, get_atomtype_name_AB(&at->atom[param->a[i]], atype));
         }
         fprintf(debug, "\n");
@@ -674,7 +674,7 @@ static gmx_bool calc_vsite3out_param(gpp_atomtype_t atype,
     }
     if (debug)
     {
-        fprintf(debug, "params for vsite3out %u: %g %g %g\n",
+        fprintf(debug, "params for vsite3out %d: %g %g %g\n",
                 param->AI+1, param->C0, param->C1, param->C2);
     }
     return bError;
@@ -732,7 +732,7 @@ static gmx_bool calc_vsite4fd_param(t_param *param,
         param->C2 = -bij;
         if (debug)
         {
-            fprintf(debug, "params for vsite4fd %u: %g %g %g\n",
+            fprintf(debug, "params for vsite4fd %d: %g %g %g\n",
                     param->AI+1, param->C0, param->C1, param->C2);
         }
     }
@@ -795,7 +795,7 @@ calc_vsite4fdn_param(t_param *param,
 
         if (debug)
         {
-            fprintf(debug, "params for vsite4fdn %u: %g %g %g\n",
+            fprintf(debug, "params for vsite4fdn %d: %g %g %g\n",
                     param->AI+1, param->C0, param->C1, param->C2);
         }
     }
@@ -866,7 +866,7 @@ int set_vsites(gmx_bool bVerbose, t_atoms *atoms, gpp_atomtype_t atype,
                     if (debug)
                     {
                         fprintf(debug, "Found %d bonds, %d angles and %d idihs "
-                                "for virtual site %u (%s)\n", nrbond, nrang, nridih,
+                                "for virtual site %d (%s)\n", nrbond, nrang, nridih,
                                 plist[ftype].param[i].AI+1,
                                 interaction_function[ftype].longname);
                         print_bad(debug, nrbond, bonds, nrang, angles, nridih, idihs);
@@ -998,7 +998,7 @@ static void check_vsite_constraints(t_params *plist,
             atom = ps->param[i].a[k];
             if (vsite_type[atom] != NOTSET)
             {
-                fprintf(stderr, "ERROR: Cannot have constraint (%u-%u) with virtual site (%u)\n",
+                fprintf(stderr, "ERROR: Cannot have constraint (%d-%d) with virtual site (%d)\n",
                         ps->param[i].AI+1, ps->param[i].AJ+1, atom+1);
                 n++;
             }
@@ -1040,7 +1040,7 @@ static void clean_vsite_bonds(t_params *plist, t_pindex pindex[],
         nvsite = 0;
         if (debug)
         {
-            fprintf(debug, "constr %u %u:", ps->param[i].AI+1, ps->param[i].AJ+1);
+            fprintf(debug, "constr %d %d:", ps->param[i].AI+1, ps->param[i].AJ+1);
         }
         for (k = 0; (k < 2) && !bKeep && !bRemove; k++)
         {
@@ -1437,10 +1437,10 @@ static void clean_vsite_dihs(t_params *plist, t_pindex pindex[],
                     }
                     if (debug)
                     {
-                        fprintf(debug, "dih w. vsite: %u %u %u %u\n",
+                        fprintf(debug, "dih w. vsite: %d %d %d %d\n",
                                 ps->param[i].AI+1, ps->param[i].AJ+1,
                                 ps->param[i].AK+1, ps->param[i].AL+1);
-                        fprintf(debug, "vsite %u from: %u %u %u\n",
+                        fprintf(debug, "vsite %d from: %d %d %d\n",
                                 atom+1, vsiteatoms[0]+1, vsiteatoms[1]+1, vsiteatoms[2]+1);
                     }
                 }
@@ -1499,7 +1499,7 @@ static void clean_vsite_dihs(t_params *plist, t_pindex pindex[],
                     bKeep = TRUE;
                     if (debug)
                     {
-                        fprintf(debug, "unused atom in dih: %u\n", atom+1);
+                        fprintf(debug, "unused atom in dih: %d\n", atom+1);
                     }
                 }
             }
index 7ee7dbe2a82715ffc47cfb04b0592e79581f0749..46030d0cbc433debf1702cfc697b04afd36dcd41 100644 (file)
@@ -261,11 +261,11 @@ int vec_shakef(FILE *fplog, gmx_shakedata_t shaked,
         if (fplog)
         {
             fprintf(fplog, "Inner product between old and new vector <= 0.0!\n"
-                    "constraint #%d atoms %u and %u\n",
+                    "constraint #%d atoms %d and %d\n",
                     error-1, iatom[3*(error-1)+1]+1, iatom[3*(error-1)+2]+1);
         }
         fprintf(stderr, "Inner product between old and new vector <= 0.0!\n"
-                "constraint #%d atoms %u and %u\n",
+                "constraint #%d atoms %d and %d\n",
                 error-1, iatom[3*(error-1)+1]+1, iatom[3*(error-1)+2]+1);
         nit = 0;
     }
index 346f029ead1de4ca142cc0102e3a0399418d4306..e95ccff45d3ce10b1c522a519ffb2f5acd7ea598 100644 (file)
@@ -175,7 +175,7 @@ void p_graph(FILE *log, const char *title, t_graph *g)
                     g->nedge[i]);
             for (j = 0; (j < g->nedge[i]); j++)
             {
-                fprintf(log, " %5u", g->edge[i][j]+1);
+                fprintf(log, " %5d", g->edge[i][j]+1);
             }
             fprintf(log, "\n");
         }
index e2ee20b87144d242f13f26c2f07daa73f2b58b33..89038a4c244c72818f46900fcee9d3809f47a4cd 100644 (file)
@@ -86,11 +86,11 @@ static void cmp_us(FILE *fp, const char *s, int index, unsigned short i1, unsign
     {
         if (index != -1)
         {
-            fprintf(fp, "%s[%d] (%u - %u)\n", s, index, i1, i2);
+            fprintf(fp, "%s[%d] (%hu - %hu)\n", s, index, i1, i2);
         }
         else
         {
-            fprintf(fp, "%s (%u - %u)\n", s, i1, i2);
+            fprintf(fp, "%s (%hu - %hu)\n", s, i1, i2);
         }
     }
 }