forked from BVLC/caffe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request BVLC#3361 from BonsaiAI/avoid-snprintf
replace snprintf with a C++98 equivalent
- Loading branch information
Showing
7 changed files
with
42 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef CAFFE_UTIL_FORMAT_H_ | ||
#define CAFFE_UTIL_FORMAT_H_ | ||
|
||
#include <iomanip> // NOLINT(readability/streams) | ||
#include <sstream> // NOLINT(readability/streams) | ||
#include <string> | ||
|
||
namespace caffe { | ||
|
||
inline std::string format_int(int n, int numberOfLeadingZeros = 0 ) { | ||
std::ostringstream s; | ||
s << std::setw(numberOfLeadingZeros) << std::setfill('0') << n; | ||
return s.str(); | ||
} | ||
|
||
} | ||
|
||
#endif // CAFFE_UTIL_FORMAT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters