Skip to content

Commit

Permalink
[Test] Fix code formatting and strings/comments grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
rikyoz committed Oct 29, 2023
1 parent 6b3d31f commit 053b55d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion include/bit7z/bitwindows.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* the two different declarations would conflict, making the compilation fail.
*
* To avoid all these issues, we define the required Win32 API structs, constants, and type aliases,
* with the same definitions in the MyWindows.h header.
* with the same definitions as in the MyWindows.h header.
* We will use only this header and avoid including "MyWindows.h" or similar headers (e.g., StdAfx.h). */
#include <cerrno>
#include <cstdint>
Expand Down
2 changes: 1 addition & 1 deletion src/bitinputarchive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ auto BitInputArchive::archiveProperty( BitProperty property ) const -> BitPropVa

auto BitInputArchive::itemProperty( uint32_t index, BitProperty property ) const -> BitPropVariant {
BitPropVariant itemProperty;
const HRESULT res = mInArchive->GetProperty( index, static_cast<PROPID>( property ), &itemProperty );
const HRESULT res = mInArchive->GetProperty( index, static_cast< PROPID >( property ), &itemProperty );
if ( res != S_OK ) {
throw BitException( "Could not retrieve property for item at the index " + std::to_string( index ),
make_hresult_code( res ) );
Expand Down
18 changes: 9 additions & 9 deletions src/bitpropvariant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ auto BitPropVariant::getNativeString() const -> native_string {
if ( vt != VT_BSTR ) {
throw BitException( "BitPropVariant is not a string", make_error_code( BitError::RequestedWrongVariantType ) );
}
//Note: a nullptr BSTR is semantically equivalent to an empty string!
// Note: a nullptr BSTR is semantically equivalent to an empty string.
return bstrVal == nullptr ? native_string{} : native_string{ bstrVal, ::SysStringLen( bstrVal ) };
#else
return getString();
Expand All @@ -273,7 +273,7 @@ auto BitPropVariant::getUInt8() const -> uint8_t {
case VT_UI1:
return bVal;
default: // not an 8-bits unsigned integer.
throw BitException( "BitPropVariant is not an 8-bits unsigned integer",
throw BitException( "BitPropVariant is not an 8-bit unsigned integer",
make_error_code( BitError::RequestedWrongVariantType ) );
}
}
Expand All @@ -285,7 +285,7 @@ auto BitPropVariant::getUInt16() const -> uint16_t {
case VT_UI2:
return uiVal;
default: // not a 16-bits unsigned integer.
throw BitException( "BitPropVariant is not a 16-bits unsigned integer",
throw BitException( "BitPropVariant is not a 16-bit unsigned integer",
make_error_code( BitError::RequestedWrongVariantType ) );
}
}
Expand All @@ -301,7 +301,7 @@ auto BitPropVariant::getUInt32() const -> uint32_t {
case VT_UI4:
return ulVal;
default: // not a 32-bits unsigned integer.
throw BitException( "BitPropVariant is not a 32-bits unsigned integer",
throw BitException( "BitPropVariant is not a 32-bit unsigned integer",
make_error_code( BitError::RequestedWrongVariantType ) );
}
}
Expand All @@ -319,7 +319,7 @@ auto BitPropVariant::getUInt64() const -> uint64_t {
case VT_UI8:
return uhVal.QuadPart;
default: // not a 64-bits unsigned integer.
throw BitException( "BitPropVariant is not a 64-bits unsigned integer",
throw BitException( "BitPropVariant is not a 64-bit unsigned integer",
make_error_code( BitError::RequestedWrongVariantType ) );
}
}
Expand All @@ -329,7 +329,7 @@ auto BitPropVariant::getInt8() const -> int8_t {
case VT_I1:
return static_cast< int8_t >( cVal );
default: // not an 8-bits integer.
throw BitException( "BitPropVariant is not an 8-bits integer",
throw BitException( "BitPropVariant is not an 8-bit integer",
make_error_code( BitError::RequestedWrongVariantType ) );
}
}
Expand All @@ -341,7 +341,7 @@ auto BitPropVariant::getInt16() const -> int16_t {
case VT_I2:
return iVal;
default: // not a 16-bits integer.
throw BitException( "BitPropVariant is not a 16-bits integer",
throw BitException( "BitPropVariant is not a 16-bit integer",
make_error_code( BitError::RequestedWrongVariantType ) );
}
}
Expand All @@ -357,7 +357,7 @@ auto BitPropVariant::getInt32() const -> int32_t {
case VT_I4:
return lVal;
default: // not a 32-bits integer.
throw BitException( "BitPropVariant is not a 32-bits integer",
throw BitException( "BitPropVariant is not a 32-bit integer",
make_error_code( BitError::RequestedWrongVariantType ) );
}
}
Expand All @@ -375,7 +375,7 @@ auto BitPropVariant::getInt64() const -> int64_t {
case VT_I8:
return hVal.QuadPart;
default: // not a 64-bits integer.
throw BitException( "BitPropVariant is not a 64-bits integer",
throw BitException( "BitPropVariant is not a 64-bit integer",
make_error_code( BitError::RequestedWrongVariantType ) );
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/internal/hresultcategory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ auto HRESULTCategory::message( int errorValue ) const -> std::string {
}
/* Note: strings obtained using FormatMessageA have a trailing space, and a \r\n pair of char.
* Using the flag FORMAT_MESSAGE_MAX_WIDTH_MASK removes the ending \r\n but leaves the trailing space.
* For this reason, we create the resulting std::string by considering msgSize - 1 as string size! */
* For this reason, we create the resulting std::string by considering msgSize - 1 as string size. */
std::string errorMessage( messageBuffer, msgSize - 1 );
LocalFree( messageBuffer );
return errorMessage;
Expand Down

0 comments on commit 053b55d

Please sign in to comment.