@@ -101,11 +101,11 @@ namespace
101
101
// -------------------------------------
102
102
103
103
static const TimeZoneDesc* getDesc (USHORT timeZone);
104
- static inline bool isOffset (USHORT timeZone);
105
- static inline SSHORT offsetZoneToDisplacement (USHORT timeZone);
106
- static inline USHORT displacementToOffsetZone (SSHORT displacement);
107
- static int parseNumber (const char *& p, const char * end);
108
- static void skipSpaces (const char *& p, const char * end);
104
+ static inline bool isOffset (USHORT timeZone) noexcept ;
105
+ static inline SSHORT offsetZoneToDisplacement (USHORT timeZone) noexcept ;
106
+ static inline USHORT displacementToOffsetZone (SSHORT displacement) noexcept ;
107
+ static int parseNumber (const char *& p, const char * end) noexcept ;
108
+ static void skipSpaces (const char *& p, const char * end) noexcept ;
109
109
110
110
// -------------------------------------
111
111
@@ -140,7 +140,7 @@ namespace
140
140
fb_utils::readenv (ICU_TIMEZONE_FILES_DIR, path);
141
141
}
142
142
143
- const PathName& get ()
143
+ const PathName& get () noexcept
144
144
{
145
145
return path;
146
146
}
@@ -175,7 +175,7 @@ namespace
175
175
}
176
176
}
177
177
178
- const ObjectsArray<TimeZoneDesc>& getTimeZoneList ()
178
+ const ObjectsArray<TimeZoneDesc>& getTimeZoneList () noexcept
179
179
{
180
180
return timeZoneList;
181
181
}
@@ -298,7 +298,7 @@ namespace
298
298
299
299
static const UDate MIN_ICU_TIMESTAMP = TimeZoneUtil::timeStampToIcuDate(TimeStamp::MIN_TIMESTAMP);
300
300
static const UDate MAX_ICU_TIMESTAMP = TimeZoneUtil::timeStampToIcuDate(TimeStamp::MAX_TIMESTAMP);
301
- static const unsigned ONE_DAY = 24 * 60 - 1 ; // used for offset encoding
301
+ static constexpr unsigned ONE_DAY = 24 * 60 - 1 ; // used for offset encoding
302
302
static InitInstance<TimeZoneDataPath> timeZoneDataPath;
303
303
static InitInstance<TimeZoneStartup> timeZoneStartup;
304
304
@@ -347,7 +347,7 @@ USHORT TimeZoneUtil::getSystemTimeZone()
347
347
if (configDefault && configDefault[0 ])
348
348
{
349
349
str = configDefault;
350
- len = strlen (str);
350
+ len = static_cast < int32_t >( strlen (str) );
351
351
}
352
352
else
353
353
{
@@ -1154,26 +1154,26 @@ static const TimeZoneDesc* getDesc(USHORT timeZone)
1154
1154
}
1155
1155
1156
1156
// Returns true if the time zone is offset-based or false if region-based.
1157
- static inline bool isOffset (USHORT timeZone)
1157
+ static inline bool isOffset (USHORT timeZone) noexcept
1158
1158
{
1159
1159
return timeZone <= ONE_DAY * 2 ;
1160
1160
}
1161
1161
1162
1162
// Gets the displacement from a offset-based time zone id.
1163
- static inline SSHORT offsetZoneToDisplacement (USHORT timeZone)
1163
+ static inline SSHORT offsetZoneToDisplacement (USHORT timeZone) noexcept
1164
1164
{
1165
1165
fb_assert (isOffset (timeZone));
1166
1166
1167
1167
return (SSHORT) (int (timeZone) - ONE_DAY);
1168
1168
}
1169
1169
1170
- static inline USHORT displacementToOffsetZone (SSHORT displacement)
1170
+ static inline USHORT displacementToOffsetZone (SSHORT displacement) noexcept
1171
1171
{
1172
1172
return (USHORT)(int (displacement) + ONE_DAY);
1173
1173
}
1174
1174
1175
1175
// Parses a integer number.
1176
- static int parseNumber (const char *& p, const char * end)
1176
+ static int parseNumber (const char *& p, const char * end) noexcept
1177
1177
{
1178
1178
const char * start = p;
1179
1179
int n = 0 ;
@@ -1188,7 +1188,7 @@ static int parseNumber(const char*& p, const char* end)
1188
1188
}
1189
1189
1190
1190
// Skip spaces and tabs.
1191
- static void skipSpaces (const char *& p, const char * end)
1191
+ static void skipSpaces (const char *& p, const char * end) noexcept
1192
1192
{
1193
1193
while (p < end && (*p == ' ' || *p == ' \t ' ))
1194
1194
++p;
0 commit comments