remove some warnings with VS2013

in time::time(unsigned hour, unsigned minute, unsigned second) constructor, add return statement if args are valid
This commit is contained in:
beru
2015-05-04 02:18:25 +09:00
parent 1b01493e9f
commit 49cc9b1ff7
5 changed files with 74 additions and 33 deletions

View File

@@ -41,6 +41,7 @@ namespace nana
int day_of_week() const;
const value & read() const;
void set(const std::tm&);
static int day_of_week(int year, int month, int day);
static unsigned year_days(unsigned year); ///< the number of days in the specified year.
@@ -67,6 +68,7 @@ namespace nana
time(const std::tm&);
time(unsigned hour, unsigned minute, unsigned second);
const value& read() const;
void set(const std::tm&);
private:
value value_;
};//end class time

View File

@@ -91,6 +91,20 @@ namespace nana
{
std::size_t strlen(const char_t* str);
char_t* strcpy(char_t* dest, const char_t* source);
#ifdef _MSC_VER
template <size_t N>
inline char* strcpy(char (&dest)[N], const char* source)
{
::strncpy_s(dest, source, _TRUNCATE);
return dest;
}
template <size_t N>
inline wchar_t* strcpy(wchar_t (&dest)[N], const wchar_t* source)
{
::wcsncpy_s(dest, source, _TRUNCATE);
return dest;
}
#endif // #ifdef _MSC_VER
}
#if defined(NANA_WINDOWS)