Import Geant4 10.3.0 source tree
This commit is contained in:
@@ -56,7 +56,7 @@ public:
|
||||
//const std::string& file_name() const {return m_fname;}
|
||||
//FILE* get_FILE() const {return m_file;}
|
||||
|
||||
bool open_file(const std::string& a_name){
|
||||
bool open_file(const std::string& a_name,bool a_anonymous = false){
|
||||
if(m_file) return false;
|
||||
|
||||
m_file = ::fopen(a_name.c_str(),"wb");
|
||||
@@ -68,9 +68,12 @@ public:
|
||||
m_pageNumber = 0;
|
||||
// Header :
|
||||
PrintFLN("%%!PS-Adobe-2.0");
|
||||
PrintFLN("%%%%Creator: tools::wps.");
|
||||
PrintFLN("%%%%CreationDate: %s",get_date());
|
||||
PrintFLN("%%%%Title: %s",m_fname.c_str());
|
||||
if(a_anonymous) { //usefull for integration tests.
|
||||
} else {
|
||||
PrintFLN("%%%%Creator: tools::wps.");
|
||||
PrintFLN("%%%%CreationDate: %s",get_date());
|
||||
PrintFLN("%%%%Title: %s",m_fname.c_str());
|
||||
}
|
||||
PrintFLN("%%%%Pages: (atend)");
|
||||
PrintFLN("%%%%BoundingBox: 0 0 %d %d",(int)m_deviceWidth,(int)m_deviceHeight);
|
||||
PrintFLN("%%%%DocumentFonts: Courier-Bold");
|
||||
@@ -341,7 +344,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
static unsigned int METAFILE_RECORD_LENGTH() {return 80;}
|
||||
static size_t METAFILE_RECORD_LENGTH() {return 80;}
|
||||
|
||||
static float METAFILE_SCALE() {return 1.0f;}
|
||||
|
||||
@@ -368,13 +371,13 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned int length = m_string.size();
|
||||
size_t length = m_string.size();
|
||||
if(length>METAFILE_RECORD_LENGTH()) {
|
||||
m_out << "tools::wps::in_buffer : overflow." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned int nlength = m_number + length;
|
||||
size_t nlength = m_number + length;
|
||||
if(nlength>METAFILE_RECORD_LENGTH()) {
|
||||
m_buffer[m_number] = '\0';
|
||||
if(::fprintf(m_file,"%s\n",(char*)m_buffer)<0) {
|
||||
@@ -431,7 +434,7 @@ protected:
|
||||
std::string m_string;
|
||||
int m_gsave;
|
||||
Uchar* m_buffer;
|
||||
unsigned int m_number;
|
||||
size_t m_number;
|
||||
//struct {
|
||||
// int shade;
|
||||
// int nbit;
|
||||
|
||||
Reference in New Issue
Block a user