@@ -37,7 +37,7 @@ static char* search_info_section(u8* buffer, u32 buffer_size)
3737 --rbegin;
3838 --r_size;
3939 } while (r_size > 0 );
40- return NULL ;
40+ return nullptr ;
4141}
4242
4343bool const configs_verifyer::verify_dsign (u8 * data, u32 data_size, sha_checksum_t & sha_checksum)
@@ -64,7 +64,7 @@ bool const configs_verifyer::verify_dsign(u8* data, u32 data_size, sha_checksum_
6464 u32 dst_size = static_cast <u32 >((data + data_size) - (u8 *)dst_buffer);
6565 u32 src_data_size = data_size - dst_size;
6666
67- LPCSTR add_str = NULL ;
67+ LPCSTR add_str = nullptr ;
6868 STRCONCAT (add_str, tmp_ini.r_string (cd_info_secion, cd_player_name_key),
6969 tmp_ini.r_string (cd_info_secion, cd_player_digest_key), tmp_ini.r_string (cd_info_secion, cd_creation_date));
7070
@@ -84,14 +84,14 @@ bool const configs_verifyer::verify_dsign(u8* data, u32 data_size, sha_checksum_
8484
8585LPCSTR configs_verifyer::get_section_diff (CInifile::Sect* sect_ptr, CInifile& active_params, string256& dst_diff)
8686{
87- LPCSTR diff_str = NULL ;
87+ pcstr diff_str = nullptr ;
8888 bool tmp_active_param = false ;
8989 if (!strncmp (sect_ptr->Name .c_str (), " ap_" , 3 ))
9090 {
9191 tmp_active_param = true ;
9292 }
9393
94- for (CInifile::SectCIt cit = sect_ptr->Data .begin (), ciet = sect_ptr->Data .end (); cit != ciet; ++cit)
94+ for (auto cit = sect_ptr->Data .cbegin (), ciet = sect_ptr->Data .cend (); cit != ciet; ++cit)
9595 {
9696 shared_str const & tmp_value = cit->second ;
9797 shared_str real_value;
@@ -102,7 +102,7 @@ LPCSTR configs_verifyer::get_section_diff(CInifile::Sect* sect_ptr, CInifile& ac
102102 real_value = active_params.r_string (sect_ptr->Name .c_str (), cit->first .c_str ());
103103 if (tmp_value != real_value)
104104 {
105- LPCSTR tmp_key_str = NULL ;
105+ pcstr tmp_key_str = nullptr ;
106106 STRCONCAT (tmp_key_str, sect_ptr->Name .c_str (), " ::" , cit->first .c_str ());
107107 STRCONCAT (diff_str, tmp_key_str, " = " , tmp_value.c_str (), " ,right = " , real_value.c_str ());
108108 strncpy_s (dst_diff, diff_str, sizeof (dst_diff) - 1 );
@@ -122,21 +122,21 @@ LPCSTR configs_verifyer::get_section_diff(CInifile::Sect* sect_ptr, CInifile& ac
122122 real_value = pSettings->r_string (sect_ptr->Name .c_str (), cit->first .c_str ());
123123 if (tmp_value != real_value)
124124 {
125- LPCSTR tmp_key_str = NULL ;
125+ pcstr tmp_key_str = nullptr ;
126126 STRCONCAT (tmp_key_str, sect_ptr->Name .c_str (), " ::" , cit->first .c_str ());
127127 STRCONCAT (diff_str, tmp_key_str, " = " , tmp_value.c_str (), " ,right = " , real_value.c_str ());
128128 strncpy_s (dst_diff, diff_str, sizeof (dst_diff) - 1 );
129129 dst_diff[sizeof (dst_diff) - 1 ] = 0 ;
130130 return dst_diff;
131131 }
132132 }
133- return NULL ;
133+ return nullptr ;
134134}
135135
136136LPCSTR configs_verifyer::get_diff (CInifile& received, CInifile& active_params, string256& dst_diff)
137137{
138- LPCSTR diff_str = NULL ;
139- for (CInifile::RootIt sit = received.sections ().begin (), siet = received.sections ().end (); sit != siet; ++sit)
138+ pcstr diff_str = nullptr ;
139+ for (auto sit = received.sections ().begin (), siet = received.sections ().end (); sit != siet; ++sit)
140140 {
141141 CInifile::Sect* tmp_sect = *sit;
142142 if (tmp_sect->Name == cd_info_secion)
@@ -163,7 +163,7 @@ bool const configs_verifyer::verify(u8* data, u32 data_size, string256& diff)
163163 }
164164 IReader tmp_reader (data, data_size);
165165 CInifile tmp_ini (&tmp_reader);
166- CInifile tmp_active_params (NULL , FALSE , FALSE , FALSE );
166+ CInifile tmp_active_params (nullptr , FALSE , FALSE , FALSE );
167167
168168 string16 tmp_digit;
169169 u32 ap_index = 1 ;
@@ -189,7 +189,7 @@ bool const configs_verifyer::verify(u8* data, u32 data_size, string256& diff)
189189 return false ;
190190 }
191191
192- LPCSTR add_str = NULL ;
192+ LPCSTR add_str = nullptr ;
193193 STRCONCAT (add_str, tmp_ini.r_string (cd_info_secion, cd_player_name_key),
194194 tmp_ini.r_string (cd_info_secion, cd_player_digest_key), tmp_ini.r_string (cd_info_secion, cd_creation_date));
195195
0 commit comments