Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
+5 -21
View File
@@ -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);
}