Import Geant4 9.6.0 source tree
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
//NOTE : on 32 or 64 bits machine, a pointer matches an unsigned long.
|
||||
|
||||
#include "typedefs"
|
||||
#include "snpf"
|
||||
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
|
||||
namespace tools {
|
||||
|
||||
@@ -29,41 +29,25 @@ inline bool to_pointer(const std::string& a_string,void*& a_value){
|
||||
|
||||
inline std::string p2s(void* a_value){
|
||||
char s[512];
|
||||
#ifdef WIN32
|
||||
_snprintf(s,sizeof(s),"%lu",(unsigned long)a_value);
|
||||
#else
|
||||
::snprintf(s,sizeof(s),"%lu",(unsigned long)a_value);
|
||||
#endif
|
||||
snpf(s,sizeof(s),"%lu",(unsigned long)a_value);
|
||||
return s;
|
||||
}
|
||||
|
||||
inline std::string p2sx(void* a_value){
|
||||
char s[512];
|
||||
#ifdef WIN32
|
||||
_snprintf(s,sizeof(s),"0x%lx",(unsigned long)a_value);
|
||||
#else
|
||||
::snprintf(s,sizeof(s),"0x%lx",(unsigned long)a_value);
|
||||
#endif
|
||||
snpf(s,sizeof(s),"0x%lx",(unsigned long)a_value);
|
||||
return s;
|
||||
}
|
||||
|
||||
inline std::string char_p2s(const char* a_value) {
|
||||
char s[512];
|
||||
#ifdef WIN32
|
||||
_snprintf(s,sizeof(s),"%lu",(unsigned long)a_value);
|
||||
#else
|
||||
::snprintf(s,sizeof(s),"%lu",(unsigned long)a_value);
|
||||
#endif
|
||||
snpf(s,sizeof(s),"%lu",(unsigned long)a_value);
|
||||
return std::string(s);
|
||||
}
|
||||
|
||||
inline std::string long2s(const long a_value) {
|
||||
char s[512];
|
||||
#ifdef WIN32
|
||||
_snprintf(s,sizeof(s),"%ld",a_value);
|
||||
#else
|
||||
::snprintf(s,sizeof(s),"%ld",a_value);
|
||||
#endif
|
||||
snpf(s,sizeof(s),"%ld",a_value);
|
||||
return std::string(s);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user