diff -crN oommf12a3/app/mmdisp/scripts/avf2ovf.tcl oommf/app/mmdisp/scripts/avf2ovf.tcl *** oommf12a3/app/mmdisp/scripts/avf2ovf.tcl 2002-10-28 13:39:00.000000000 -0500 --- oommf/app/mmdisp/scripts/avf2ovf.tcl 2004-12-17 18:58:00.000000000 -0500 *************** *** 56,63 **** } } # Relative order check ! if {$args[0]>$args[3] || $args[1]>$args[4] \ ! || $args[2]>$args[5]} { set okaystr 0 } } --- 56,64 ---- } } # Relative order check ! if {[lindex $args 0]>[lindex $args 3] \ ! || [lindex $args 1]>[lindex $args 4] \ ! || [lindex $args 2]>[lindex $args 5]} { set okaystr 0 } } *************** *** 74,81 **** {zmax { ClipStringCheck $xmin $ymin $zmin $xmax $ymax $zmax} {is maximum z}} } { ! upvar #0 clipstr globalclipstr ! set globalclipstr $clipstr } "\n\tClipping box (optional)" set clipstr {} --- 75,82 ---- {zmax { ClipStringCheck $xmin $ymin $zmin $xmax $ymax $zmax} {is maximum z}} } { ! global clipstr ! set clipstr [list $xmin $ymin $zmin $xmax $ymax $zmax] } "\n\tClipping box (optional)" set clipstr {} diff -crN oommf12a3/app/oxs/base/mesh.cc oommf/app/oxs/base/mesh.cc *** oommf12a3/app/oxs/base/mesh.cc 2002-10-30 17:49:23.000000000 -0500 --- oommf/app/oxs/base/mesh.cc 2004-12-17 18:58:00.000000000 -0500 *************** *** 183,201 **** INT4m size=Size(); for(INT4m i=0 ; i(loc.x); ! buf[1] = static_cast(loc.y); ! buf[2] = static_cast(loc.z); const ThreeVector& v = (*vec)[i]; if(scale==NULL) { ! buf[3] = static_cast(v.x); ! buf[4] = static_cast(v.y); ! buf[5] = static_cast(v.z); } else { REAL8m tempscale=(*scale)[i]; ! buf[3] = static_cast(tempscale*v.x); ! buf[4] = static_cast(tempscale*v.y); ! buf[5] = static_cast(tempscale*v.z); } Vf_OvfFileFormatSpecs::WriteBinary(channel,buf,6); // Vf_OvfFileFormatSpecs::WriteBinary performs *************** *** 210,228 **** INT4m size=Size(); for(INT4m i=0 ; i(loc.x); ! buf[1] = static_cast(loc.y); ! buf[2] = static_cast(loc.z); const ThreeVector& v = (*vec)[i]; if(scale==NULL) { ! buf[3] = static_cast(v.x); ! buf[4] = static_cast(v.y); ! buf[5] = static_cast(v.z); } else { REAL8m tempscale=(*scale)[i]; ! buf[3] = static_cast(tempscale*v.x); ! buf[4] = static_cast(tempscale*v.y); ! buf[5] = static_cast(tempscale*v.z); } Vf_OvfFileFormatSpecs::WriteBinary(channel,buf,6); // Vf_OvfFileFormatSpecs::WriteBinary performs diff -crN oommf12a3/app/oxs/base/mif.tcl oommf/app/oxs/base/mif.tcl *** oommf12a3/app/oxs/base/mif.tcl 2002-10-29 16:09:00.000000000 -0500 --- oommf/app/oxs/base/mif.tcl 2004-12-17 18:58:00.000000000 -0500 *************** *** 201,208 **** # Set up the schedule append script " ! Oxs_Schedule Set $o $d Frequency $e $f ! Oxs_Schedule Set $o $d Active $e 1 " } eval $script --- 201,208 ---- # Set up the schedule append script " ! [list Oxs_Schedule Set $o $d Frequency $e $f] ! [list Oxs_Schedule Set $o $d Active $e 1] " } eval $script diff -crN oommf12a3/app/oxs/base/oxs.cc oommf/app/oxs/base/oxs.cc *** oommf12a3/app/oxs/base/oxs.cc 2002-01-30 21:40:15.000000000 -0500 --- oommf/app/oxs/base/oxs.cc 2004-12-17 18:58:00.000000000 -0500 *************** *** 6,11 **** --- 6,12 ---- #include "oc.h" #include "nb.h" + #include "vf.h" #include "oxs.h" #include "director.h" *************** *** 126,131 **** --- 127,142 ---- } Tcl_StaticPackage(interp, ab("Nb"), Nb_Init, NULL); + if (Vf_Init(interp) == TCL_ERROR) { + Tcl_DStringInit(&buf); + Tcl_DStringAppend(&buf, ab("Oc_Log Log"), -1); + Tcl_DStringAppendElement(&buf, Tcl_GetStringResult(interp)); + Tcl_DStringAppendElement(&buf, ab("error")); + Tcl_Eval(interp, Tcl_DStringValue(&buf)); + Tcl_DStringFree(&buf); + } + Tcl_StaticPackage(interp, ab("Vf"), Vf_Init, NULL); + if (Oxs_Init(interp) != TCL_OK) { Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf,Oc_AutoBuf("Oc_Log Log"),-1); diff -crN oommf12a3/app/oxs/base/util.cc oommf/app/oxs/base/util.cc *** oommf12a3/app/oxs/base/util.cc 2002-04-05 19:29:23.000000000 -0500 --- oommf/app/oxs/base/util.cc 2004-12-17 18:58:00.000000000 -0500 *************** *** 81,113 **** delete[] arr; } ! OxsTclObjConstPtrConstRef Oxs_TclObjArray::operator[](int index) const { #ifndef NDEBUG if(index>=size || index<0) { char buf[512]; Oc_Snprintf(buf,sizeof(buf), ! "const Tcl_Obj*& Oxs_TclObjArray::operator[] const: " "Array out-of-bounds; index=%d, size=%d", index,size); OXS_THROW(Oxs_BadIndex,buf); } #endif ! return static_cast(arr[index]); ! /// Brute-force the cast, which assumes that there is no storage ! /// difference between TclObj* and const TclObj*, at least in ! /// the indicated direction. This cast is needed by some compilers, ! /// which otherwise return a reference to a temporary, which is ! /// definitely *not* what we want! } ! OxsTclObjPtrRef Oxs_TclObjArray::operator[](int index) { #ifndef NDEBUG if(index>=size || index<0) { char buf[512]; Oc_Snprintf(buf,sizeof(buf), ! "Tcl_Obj*& Oxs_TclObjArray::operator[]: " "Array out-of-bounds; index=%d, size=%d", index,size); OXS_THROW(Oxs_BadIndex,buf); --- 81,108 ---- delete[] arr; } ! OxsTclObjPtr& Oxs_TclObjArray::operator[](int index) { #ifndef NDEBUG if(index>=size || index<0) { char buf[512]; Oc_Snprintf(buf,sizeof(buf), ! "Tcl_Obj*& Oxs_TclObjArray::operator[]: " "Array out-of-bounds; index=%d, size=%d", index,size); OXS_THROW(Oxs_BadIndex,buf); } #endif ! return arr[index]; } ! const OxsTclObjPtr& Oxs_TclObjArray::operator[](int index) const { #ifndef NDEBUG if(index>=size || index<0) { char buf[512]; Oc_Snprintf(buf,sizeof(buf), ! "const Tcl_Obj*& Oxs_TclObjArray::operator[] const: " "Array out-of-bounds; index=%d, size=%d", index,size); OXS_THROW(Oxs_BadIndex,buf); *************** *** 136,142 **** Tcl_Obj* obj = arr[index]; if (Tcl_IsShared(obj)) { Tcl_Obj* tmp = obj; ! obj = Tcl_DuplicateObj(obj); // Create copy to write on Tcl_IncrRefCount(obj); Tcl_DecrRefCount(tmp); } --- 131,137 ---- Tcl_Obj* obj = arr[index]; if (Tcl_IsShared(obj)) { Tcl_Obj* tmp = obj; ! arr[index] = obj = Tcl_DuplicateObj(obj); // Create copy to write on Tcl_IncrRefCount(obj); Tcl_DecrRefCount(tmp); } *************** *** 167,173 **** Tcl_Obj* obj = arr[index]; if (Tcl_IsShared(obj)) { Tcl_Obj* tmp = obj; ! obj = Tcl_DuplicateObj(obj); // Create copy to write on Tcl_IncrRefCount(obj); Tcl_DecrRefCount(tmp); } --- 162,168 ---- Tcl_Obj* obj = arr[index]; if (Tcl_IsShared(obj)) { Tcl_Obj* tmp = obj; ! arr[index] = obj = Tcl_DuplicateObj(obj); // Create copy to write on Tcl_IncrRefCount(obj); Tcl_DecrRefCount(tmp); } *************** *** 190,196 **** Tcl_Obj* obj = arr[index]; if (Tcl_IsShared(obj)) { Tcl_Obj* tmp = obj; ! obj = Tcl_DuplicateObj(obj); // Create copy to write on Tcl_IncrRefCount(obj); Tcl_DecrRefCount(tmp); } --- 185,191 ---- Tcl_Obj* obj = arr[index]; if (Tcl_IsShared(obj)) { Tcl_Obj* tmp = obj; ! arr[index] = obj = Tcl_DuplicateObj(obj); // Create copy to write on Tcl_IncrRefCount(obj); Tcl_DecrRefCount(tmp); } *************** *** 213,219 **** Tcl_Obj* obj = arr[index]; if (Tcl_IsShared(obj)) { Tcl_Obj* tmp = obj; ! obj = Tcl_DuplicateObj(obj); // Create copy to write on Tcl_IncrRefCount(obj); Tcl_DecrRefCount(tmp); } --- 208,214 ---- Tcl_Obj* obj = arr[index]; if (Tcl_IsShared(obj)) { Tcl_Obj* tmp = obj; ! arr[index] = obj = Tcl_DuplicateObj(obj); // Create copy to write on Tcl_IncrRefCount(obj); Tcl_DecrRefCount(tmp); } diff -crN oommf12a3/app/oxs/base/util.h oommf/app/oxs/base/util.h *** oommf12a3/app/oxs/base/util.h 2002-07-08 20:51:30.000000000 -0400 --- oommf/app/oxs/base/util.h 2004-12-17 18:58:00.000000000 -0500 *************** *** 48,56 **** //////////////////////////////////////////////////////////////////////// // Wrapper for Tcl_Obj** typedef Tcl_Obj* OxsTclObjPtr; - typedef OxsTclObjPtr& OxsTclObjPtrRef; - typedef const Tcl_Obj* OxsTclObjConstPtr; - typedef OxsTclObjConstPtr const & OxsTclObjConstPtrConstRef; class Oxs_TclObjArray { private: --- 48,53 ---- *************** *** 60,71 **** Oxs_TclObjArray(int arrsize); ~Oxs_TclObjArray(); ! OxsTclObjPtrRef operator[](int index); ! OxsTclObjConstPtrConstRef operator[](int index) const; ! /// It is not entirely clear to me whether the latter should return a ! /// constant reference to a constant pointer, or a constant reference ! /// to a non-constant pointer. We'll try the more restrictive ! /// approach first. -mjd, 19-Feb-2002. int Size() const { return size; } Tcl_Obj** Array() { return arr; } --- 57,64 ---- Oxs_TclObjArray(int arrsize); ~Oxs_TclObjArray(); ! OxsTclObjPtr& operator[](int index); ! const OxsTclObjPtr& operator[](int index) const; int Size() const { return size; } Tcl_Obj** Array() { return arr; } diff -crN oommf12a3/app/oxs/boxsi.tcl oommf/app/oxs/boxsi.tcl *** oommf12a3/app/oxs/boxsi.tcl 2002-10-29 16:32:05.000000000 -0500 --- oommf/app/oxs/boxsi.tcl 2004-12-17 18:58:00.000000000 -0500 *************** *** 797,802 **** --- 797,803 ---- # Now that connections to servers are established, it's safe # to process options and possibly start computing. uplevel #0 {Oc_CommandLine Parse $argv} + global nice if {$nice} { Oc_MakeNice } diff -crN oommf12a3/app/oxs/ext/atlasscalarfield.cc oommf/app/oxs/ext/atlasscalarfield.cc *** oommf12a3/app/oxs/ext/atlasscalarfield.cc 2002-03-20 19:21:44.000000000 -0500 --- oommf/app/oxs/ext/atlasscalarfield.cc 2004-12-17 18:58:00.000000000 -0500 *************** *** 40,50 **** OxsASFSpecifiedValue default_value; if(HasInitValue("default_value")) { default_value.value=GetRealInitValue("default_value"); ! default_value.isset=1; } // Fill out value vector with default_value. This is essentially ! // an empty padding if default.isset==0. unsigned int i; for(i=0;iGetRegionCount();i++) { values.push_back(default_value); --- 40,50 ---- OxsASFSpecifiedValue default_value; if(HasInitValue("default_value")) { default_value.value=GetRealInitValue("default_value"); ! default_value.value_is_set=1; } // Fill out value vector with default_value. This is essentially ! // an empty padding if default.value_is_set==0. unsigned int i; for(i=0;iGetRegionCount();i++) { values.push_back(default_value); *************** *** 86,92 **** value.c_str(),name.c_str()); throw Oxs_Ext::Error(this,buf); } else { ! values[region_id].isset = 1; } } DeleteInitValue("values"); --- 86,92 ---- value.c_str(),name.c_str()); throw Oxs_Ext::Error(this,buf); } else { ! values[region_id].value_is_set = 1; } } DeleteInitValue("values"); *************** *** 102,108 **** { const Oxs_Atlas* atlas = atlas_key.GetPtr(); INT4m id = atlas->GetRegionId(pt); ! if(!values[id].isset) { char buf[1024]; string regionname; atlas->GetRegionName(id,regionname); --- 102,108 ---- { const Oxs_Atlas* atlas = atlas_key.GetPtr(); INT4m id = atlas->GetRegionId(pt); ! if(!values[id].value_is_set) { char buf[1024]; string regionname; atlas->GetRegionName(id,regionname); diff -crN oommf12a3/app/oxs/ext/atlasscalarfield.h oommf/app/oxs/ext/atlasscalarfield.h *** oommf12a3/app/oxs/ext/atlasscalarfield.h 2002-03-21 15:05:10.000000000 -0500 --- oommf/app/oxs/ext/atlasscalarfield.h 2004-12-17 18:58:00.000000000 -0500 *************** *** 21,29 **** // Struct for use inside Oxs_AtlasScalarField class only. // Defined outside that class to please MSVC++ 5.0. struct OxsASFSpecifiedValue { ! BOOL isset; REAL8m value; ! OxsASFSpecifiedValue() : isset(0), value(0.) {} }; // The next 3 operators are defined so MSVC++ 5.0 will accept // vector, but are left undefined because --- 21,29 ---- // Struct for use inside Oxs_AtlasScalarField class only. // Defined outside that class to please MSVC++ 5.0. struct OxsASFSpecifiedValue { ! BOOL value_is_set; REAL8m value; ! OxsASFSpecifiedValue() : value_is_set(0), value(0.) {} }; // The next 3 operators are defined so MSVC++ 5.0 will accept // vector, but are left undefined because diff -crN oommf12a3/app/oxs/ext/atlasvectorfield.cc oommf/app/oxs/ext/atlasvectorfield.cc *** oommf12a3/app/oxs/ext/atlasvectorfield.cc 2002-03-20 19:21:44.000000000 -0500 --- oommf/app/oxs/ext/atlasvectorfield.cc 2004-12-17 18:58:00.000000000 -0500 *************** *** 47,58 **** OxsAVFSpecifiedValue default_value; if(HasInitValue("default_value")) { default_value.value = GetThreeVectorInitValue("default_value"); ! default_value.isset = 1; if(set_norm) default_value.value.SetMag(norm); } // Fill out value vector with default_value. This is essentially ! // an empty padding if default.isset==0. unsigned int i; for(i=0;iGetRegionCount();i++) { values.push_back(default_value); --- 47,58 ---- OxsAVFSpecifiedValue default_value; if(HasInitValue("default_value")) { default_value.value = GetThreeVectorInitValue("default_value"); ! default_value.value_is_set = 1; if(set_norm) default_value.value.SetMag(norm); } // Fill out value vector with default_value. This is essentially ! // an empty padding if default.value_is_set==0. unsigned int i; for(i=0;iGetRegionCount();i++) { values.push_back(default_value); *************** *** 98,104 **** name.c_str(),atlas_obj->InstanceName()); throw Oxs_Ext::Error(this,buf); } else { ! values[region_id].isset = 1; } } DeleteInitValue("values"); --- 98,104 ---- name.c_str(),atlas_obj->InstanceName()); throw Oxs_Ext::Error(this,buf); } else { ! values[region_id].value_is_set = 1; } } DeleteInitValue("values"); *************** *** 116,122 **** { const Oxs_Atlas* atlas = atlas_key.GetPtr(); INT4m id = atlas->GetRegionId(pt); ! if(!values[id].isset) { char buf[1024]; string regionname; atlas->GetRegionName(id,regionname); --- 116,122 ---- { const Oxs_Atlas* atlas = atlas_key.GetPtr(); INT4m id = atlas->GetRegionId(pt); ! if(!values[id].value_is_set) { char buf[1024]; string regionname; atlas->GetRegionName(id,regionname); diff -crN oommf12a3/app/oxs/ext/atlasvectorfield.h oommf/app/oxs/ext/atlasvectorfield.h *** oommf12a3/app/oxs/ext/atlasvectorfield.h 2002-03-21 15:05:10.000000000 -0500 --- oommf/app/oxs/ext/atlasvectorfield.h 2004-12-17 18:58:00.000000000 -0500 *************** *** 21,29 **** // Struct for use inside Oxs_AtlasVectorField class only. // Defined outside that class to please MSVC++ 5.0. struct OxsAVFSpecifiedValue { ! BOOL isset; ThreeVector value; ! OxsAVFSpecifiedValue() : isset(0), value(0.,0.,0.) {} }; // The next 3 operators are defined so MSVC++ 5.0 will accept // vector, but are left undefined because --- 21,29 ---- // Struct for use inside Oxs_AtlasVectorField class only. // Defined outside that class to please MSVC++ 5.0. struct OxsAVFSpecifiedValue { ! BOOL value_is_set; ThreeVector value; ! OxsAVFSpecifiedValue() : value_is_set(0), value(0.,0.,0.) {} }; // The next 3 operators are defined so MSVC++ 5.0 will accept // vector, but are left undefined because diff -crN oommf12a3/app/oxs/ext/rectangularmesh.cc oommf/app/oxs/ext/rectangularmesh.cc *** oommf12a3/app/oxs/ext/rectangularmesh.cc 2002-09-12 01:52:08.000000000 -0400 --- oommf/app/oxs/ext/rectangularmesh.cc 2004-12-17 18:58:00.000000000 -0500 *************** *** 383,396 **** for(INT4m i=0 ; i(v.x); ! buf[1] = static_cast(v.y); ! buf[2] = static_cast(v.z); } else { REAL8m tempscale=(*scale)[i]; ! buf[0] = static_cast(tempscale*v.x); ! buf[1] = static_cast(tempscale*v.y); ! buf[2] = static_cast(tempscale*v.z); } Vf_OvfFileFormatSpecs::WriteBinary(channel,buf,3); // Vf_OvfFileFormatSpecs::WriteBinary performs *************** *** 406,419 **** for(INT4m i=0 ; i(v.x); ! buf[1] = static_cast(v.y); ! buf[2] = static_cast(v.z); } else { REAL8m tempscale=(*scale)[i]; ! buf[0] = static_cast(tempscale*v.x); ! buf[1] = static_cast(tempscale*v.y); ! buf[2] = static_cast(tempscale*v.z); } Vf_OvfFileFormatSpecs::WriteBinary(channel,buf,3); // Vf_OvfFileFormatSpecs::WriteBinary performs diff -crN oommf12a3/app/oxs/ext/uzeeman.cc oommf/app/oxs/ext/uzeeman.cc *** oommf12a3/app/oxs/ext/uzeeman.cc 2002-06-18 23:36:00.000000000 -0400 --- oommf/app/oxs/ext/uzeeman.cc 2004-12-17 18:58:00.000000000 -0500 *************** *** 65,79 **** i,hrange[i].c_str()); throw Oxs_Ext::Error(this,buf); } ! h0*=hmult; ! h1*=hmult; ! if(step_count==0 || Happ.size()==0 || Happ.back()!=h0 ) { Happ.push_back(h0); } ! for(UINT4m j=1;j<=step_count;j++) { ! REAL8m t = REAL8m(j)/REAL8m(step_count); Happ.push_back(((1-t)*h0) + (t*h1)); } } DeleteInitValue("Hrange"); VerifyAllInitArgsUsed(); --- 65,98 ---- i,hrange[i].c_str()); throw Oxs_Ext::Error(this,buf); } ! // Note: There is a potential problem comparing Happ.back() to h0 if ! // any floating point operations have occured on either. If those ! // operations are not exactly the same, there may be differences in ! // round-off error. Even if they are written the same in the source ! // code, if the compiler is given license to re-order floating point ! // ops, then the results may differ. Also, there may be differences ! // between values loaded from memory and those stored in registers. ! // The code below attempts to work around these issues. ! if(step_count==0 || Happ.size()==0) { Happ.push_back(h0); + } else { + ThreeVector last_h1 = Happ.back(); + if(fabs(last_h1.x-h0.x)>fabs(h0.x)*REAL8_EPSILON*2 + || fabs(last_h1.y-h0.y)>fabs(h0.y)*REAL8_EPSILON*2 + || fabs(last_h1.z-h0.z)>fabs(h0.z)*REAL8_EPSILON*2) { + Happ.push_back(h0); + } } ! for(UINT4m j=1;j(j)/static_cast(step_count); Happ.push_back(((1-t)*h0) + (t*h1)); } + if(step_count>0) Happ.push_back(h1); + } + vector::iterator it = Happ.begin(); + while(it!=Happ.end()) { + *it *= hmult; + ++it; } DeleteInitValue("Hrange"); VerifyAllInitArgsUsed(); diff -crN oommf12a3/app/pimake/platform.tcl oommf/app/pimake/platform.tcl *** oommf12a3/app/pimake/platform.tcl 2001-01-23 15:21:33.000000000 -0500 --- oommf/app/pimake/platform.tcl 2004-12-17 18:51:36.000000000 -0500 *************** *** 247,252 **** --- 247,256 ---- if {[llength $args]} { return -code error "Expected option, but saw '[lindex $args 0]'" } + # Workaround for ${DBGX} values sprinkled in old broken + # tclConfig.sh and tkConfig.sh files. + regsub -all {\${DBGX}} $linkcmd {} linkcmd + # if {[catch {eval Oc_Exec Foreground $linkcmd} msg]} { global errorCode set ec $errorCode diff -crN oommf12a3/config/cache/wintel.tcl oommf/config/cache/wintel.tcl *** oommf12a3/config/cache/wintel.tcl 2002-10-30 20:31:44.000000000 -0500 --- oommf/config/cache/wintel.tcl 2004-12-17 18:58:00.000000000 -0500 *************** *** 134,145 **** # The program to run on this platform to create a single library file out # of many object files. # Microsoft Visual C++'s library maker ! $config SetValue program_libmaker {lib} # The program to run on this platform to link together object files and # library files to create an executable binary. # Microsoft Visual C++'s linker ! $config SetValue program_linker {link /DEBUG} } elseif {[string match icl $ccbasename]} { # ... for Intel C++ --- 134,147 ---- # The program to run on this platform to create a single library file out # of many object files. # Microsoft Visual C++'s library maker ! $config SetValue program_libmaker {link /lib} ! # If your link doesn't accept the /lib option, try this instead: ! # $config SetValue program_libmaker {lib} # The program to run on this platform to link together object files and # library files to create an executable binary. # Microsoft Visual C++'s linker ! $config SetValue program_linker {link} } elseif {[string match icl $ccbasename]} { # ... for Intel C++ *************** *** 245,253 **** unset ccbasename # Library making option processing... ! set libbasename [file tail [lindex [$config GetValue program_libmaker] 0]] ! if {[string match lib $libbasename]} { ! # ...for Microsoft VC++ lib $config SetValue program_libmaker_option_obj {format \"%s\"} $config SetValue program_libmaker_option_out {format "\"/OUT:%s\""} } elseif {[string match xilib $libbasename]} { --- 247,259 ---- unset ccbasename # Library making option processing... ! if {[catch {$config GetValue program_libmaker} libbasename]} { ! set libbasename {} ;# No librarian specified ! } else { ! set libbasename [file tail [lindex $libbasename 0]] ! } ! if {[string match lib $libbasename] || [string match link $libbasename]} { ! # ...for Microsoft VC++ lib or "link /lib" $config SetValue program_libmaker_option_obj {format \"%s\"} $config SetValue program_libmaker_option_out {format "\"/OUT:%s\""} } elseif {[string match xilib $libbasename]} { diff -crN oommf12a3/pkg/nb/evoc.cc oommf/pkg/nb/evoc.cc *** oommf12a3/pkg/nb/evoc.cc 2002-10-25 16:49:02.000000000 -0400 --- oommf/pkg/nb/evoc.cc 2004-12-17 18:58:00.000000000 -0500 *************** *** 4,10 **** * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2002/10/25 20:49:02 $ * Last modified by: $Author: donahue $ */ --- 4,10 ---- * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2002/11/18 19:44:17 $ * Last modified by: $Author: donahue $ */ *************** *** 437,447 **** // smaller than the last then a wrap-around of 1 period is assumed. // This will not work properly if the time between calls to this // function is larger than the wrap-around period. For an 4-byte wide ! // clock_t with CLOCKS_PER_SECOND at 1024, the time to overflow is ! // about 48.5 days (Windows NT). With CLOCKS_PER_SECOND at 1000000 // overflow time is just over 71 minutes (Linux/x86). OTOH, an 8-byte // wide clock_t with a nanosecond tick rate takes over 584 years to ! // overflow. NOTE 1: Even though CLOCKS_PER_SECOND is 1e6 on // Linux/x86, the granularity of all user-accessible clocks appears to // be only 1/100 seconds (=1/CLK_TCK). On Linux/AXP, CLK_TCK is 1000 // (and clock_t is 8 bytes wide). NOTE 2: The wrap around periods are --- 437,447 ---- // smaller than the last then a wrap-around of 1 period is assumed. // This will not work properly if the time between calls to this // function is larger than the wrap-around period. For an 4-byte wide ! // clock_t with CLOCKS_PER_SEC at 1024, the time to overflow is ! // about 48.5 days (Windows NT). With CLOCKS_PER_SEC at 1000000 // overflow time is just over 71 minutes (Linux/x86). OTOH, an 8-byte // wide clock_t with a nanosecond tick rate takes over 584 years to ! // overflow. NOTE 1: Even though CLOCKS_PER_SEC is 1e6 on // Linux/x86, the granularity of all user-accessible clocks appears to // be only 1/100 seconds (=1/CLK_TCK). On Linux/AXP, CLK_TCK is 1000 // (and clock_t is 8 bytes wide). NOTE 2: The wrap around periods are *************** *** 467,474 **** ///// TEMPORARY MACROS, TO BE FIXED UP BY DGP //////////////////// #if !defined(NO_CLOCKS) && (SYSTEM_TYPE != WINDOWS) ! # if !defined(CLK_TCK) && defined(HZ) ! # define CLK_TCK HZ # endif # ifdef CLK_TCK # define HAS_TIMES --- 467,478 ---- ///// TEMPORARY MACROS, TO BE FIXED UP BY DGP //////////////////// #if !defined(NO_CLOCKS) && (SYSTEM_TYPE != WINDOWS) ! # ifndef CLK_TCK ! # ifdef _SC_CLK_TCK ! static const long CLK_TCK = sysconf(_SC_CLK_TCK); ! # elif defined(HZ) ! # define CLK_TCK HZ ! # endif # endif # ifdef CLK_TCK # define HAS_TIMES *************** *** 526,532 **** # ifdef HAS_CLOCK static Oc_TimeVal cpu_accum(CLOCKS_PER_SEC,(unsigned long)clock_t(-1)); static Oc_TimeVal cpu_last(CLOCKS_PER_SEC,(unsigned long)clock_t(-1)); ! static Oc_TimeVal cpu_now(CLK_TCK,(unsigned long)clock_t(-1)); cpu_now.ticks=clock(); cpu_now.overflow=cpu_last.overflow; if(cpu_now.ticks [llength $marklist]} { # Remove extra windows from end. We have to disable # bindings on $winscale because otherwise Tk --- 491,498 ---- private method UpdateMarkList {} { if {[string match {} $winscale]} { return } # Delete any excess mark windows + set markwindows [winfo children $winscale] if {[llength $markwindows] > [llength $marklist]} { # Remove extra windows from end. We have to disable # bindings on $winscale because otherwise Tk *************** *** 543,552 **** } set id 0 foreach mark $slist { ! if {$mark<$scalemin || $mark>$scalemax} { continue } ! set xpos [lindex [$winscale coords $mark] 0] ! place $winscale.mark$id \ ! -x $xpos -y 0 -relheight 1 -anchor $anchor incr id } } --- 538,550 ---- } set id 0 foreach mark $slist { ! if {$mark<$scalemin || $mark>$scalemax} { ! place forget $winscale.mark$id ! } else { ! set xpos [lindex [$winscale coords $mark] 0] ! place $winscale.mark$id \ ! -x $xpos -y 0 -relheight 1 -anchor $anchor ! } incr id } } diff -crN oommf12a3/pkg/ow/procs.tcl oommf/pkg/ow/procs.tcl *** oommf12a3/pkg/ow/procs.tcl 2001-07-02 03:36:40.000000000 -0400 --- oommf/pkg/ow/procs.tcl 2004-12-17 18:58:00.000000000 -0500 *************** *** 459,464 **** --- 459,467 ---- # Routines to push/pop watch cursor onto all currently # existing toplevel windows. # + frame .owhiddencursorframe -cursor watch ;# Leave this unmapped; + ## the purpose is just to hold a reference to the watch cursor + ## as a workaround to an apparent X memory leak. set _watch_cursor_count 0 set _watch_cursor_safetyid {} proc Ow_PushWatchCursor {} { diff -crN oommf12a3/pkg/oc/commandline.tcl oommf/pkg/oc/commandline.tcl *** oommf12a3/pkg/oc/commandline.tcl Mon Oct 28 20:25:00 2002 --- oommf/pkg/oc/commandline.tcl Thu Jun 1 14:34:45 2006 *************** *** 319,325 **** set code [catch {eval _${class}_HandleOption $save($opt)} result] rename _${class}_HandleOption {} if {$code} { ! error $result "\n$result\n \ (command line option '$sswitch$opt')" } } --- 319,326 ---- set code [catch {eval _${class}_HandleOption $save($opt)} result] rename _${class}_HandleOption {} if {$code} { ! global errorInfo ! error $result "$errorInfo\n \ (command line option '$sswitch$opt')" } } *************** *** 404,410 **** set code [catch {eval _${class}_Process $rest} result] rename _${class}_Process {} if {$code} { ! error $result "\n$result\n (command line arguments\ '$arg($sswitch)')" } } --- 405,412 ---- set code [catch {eval _${class}_Process $rest} result] rename _${class}_Process {} if {$code} { ! global errorInfo ! error $result "$errorInfo\n (command line arguments\ '$arg($sswitch)')" } } diff -crN oommf12a3/pkg/oc/oc.cc oommf/pkg/oc/oc.cc *** oommf12a3/pkg/oc/oc.cc Wed Oct 23 02:43:45 2002 --- oommf/pkg/oc/oc.cc Tue Dec 12 04:05:11 2006 *************** *** 260,268 **** --- 260,273 ---- #endif // DEBUG_DISABLESTDIO // Disable future SIGHUP, SIGTIN and SIGTOU signals + #if 1 && (SYSTEM_TYPE==WINDOWS) + signal(SIGBREAK,SIG_IGN); + signal(SIGABRT,SIG_IGN); + #else signal(SIGHUP,SIG_IGN); signal(SIGTTIN,SIG_IGN); signal(SIGTTOU,SIG_IGN); + #endif } static int *************** *** 284,290 **** // a value outside this set. Note that signal() will correctly // return a TCL_ERROR if the value is outside the known set of // signals. ! #if 0 && (SYSTEM_TYPE==WINDOWS) if(signo!=SIGINT && signo!=SIGILL && signo!=SIGFPE && signo!=SIGSEGV && signo!=SIGTERM && signo!=SIGBREAK && signo!=SIGABRT) --- 289,295 ---- // a value outside this set. Note that signal() will correctly // return a TCL_ERROR if the value is outside the known set of // signals. ! #if 1 && (SYSTEM_TYPE==WINDOWS) if(signo!=SIGINT && signo!=SIGILL && signo!=SIGFPE && signo!=SIGSEGV && signo!=SIGTERM && signo!=SIGBREAK && signo!=SIGABRT) diff -crN oommf12a3/config/cache/wintel.tcl oommf/config/cache/wintel.tcl *** oommf12a3/config/cache/wintel.tcl Wed Oct 30 20:31:44 2002 --- oommf/config/cache/wintel.tcl Tue Dec 12 20:02:31 2006 *************** *** 60,69 **** # # Microsoft Visual C++ # ! $config SetValue program_compiler_c++ {cl /nologo /c /GX /GR} # # Intel C++ ! #$config SetValue program_compiler_c++ {icl /nologo /c /GX /GR} # # Borland C++ 5.5 Win32 command line tools. # --- 60,69 ---- # # Microsoft Visual C++ # ! #$config SetValue program_compiler_c++ {cl /nologo /c /GX /GR} # # Intel C++ ! $config SetValue program_compiler_c++ {icl /nologo /c /GX /GR} # # Borland C++ 5.5 Win32 command line tools. # diff -crN oommf12a3/config/cache/wintel.tcl oommf12a3-patched/config/cache/wintel.tcl *** oommf12a3/config/cache/wintel.tcl Wed Oct 30 22:01:12 2002 --- oommf12a3-patched/config/cache/wintel.tcl Tue Dec 12 18:04:25 2006 *************** *** 60,69 **** # # Microsoft Visual C++ # ! #$config SetValue program_compiler_c++ {cl /nologo /c /GX /GR} # # Intel C++ ! $config SetValue program_compiler_c++ {icl /nologo /c /GX /GR} # # Borland C++ 5.5 Win32 command line tools. # --- 60,69 ---- # # Microsoft Visual C++ # ! $config SetValue program_compiler_c++ {cl /nologo /c /GR} # # Intel C++ ! #$config SetValue program_compiler_c++ {icl /nologo /c /GX /GR} # # Borland C++ 5.5 Win32 command line tools. # *************** *** 98,118 **** # $config SetValue path_directory_temporary {C:\} ######################################################################## # ADVANCED CONFIGURATION # Compiler option processing... set ccbasename [file tail [lindex [$config GetValue program_compiler_c++] 0]] if {[string match cl $ccbasename]} { # ... for Microsoft Visual C++ ! # Default optimization ! # $config SetValue program_compiler_c++_option_opt {} ! # Options: # Maximum optimization: /Ox # Enable runtime debug checks: /GZ # Optimize for Pentium processor: /G5 # Optimize for Pentium Pro: /G6 ! #$config SetValue program_compiler_c++_option_opt {format "/GZ"} ! $config SetValue program_compiler_c++_option_opt {format "/Ox"} # NOTE: If you want good performance, be sure to edit ../options.tcl # or ../local/options.tcl to include the line # Oc_Option Add * Platform cflags {-def NDEBUG} --- 98,173 ---- # $config SetValue path_directory_temporary {C:\} ######################################################################## + # SUPPORT PROCEDURES + # + # Routine to guess the cl version + proc GuessClVersion { cl } { + set guess {} + catch {exec $cl} usage_str + if {[regexp -- {Version ([0-9]+)[.][0-9]+[.][0-9]+} \ + $usage_str dummy version]} { + set guess [expr {$version - 6}] + } + return $guess + } + + ######################################################################## # ADVANCED CONFIGURATION # Compiler option processing... set ccbasename [file tail [lindex [$config GetValue program_compiler_c++] 0]] if {[string match cl $ccbasename]} { # ... for Microsoft Visual C++ ! if {![info exists mvcpp_version]} { ! set compilestr [$config GetValue program_compiler_c++] ! set mvcpp_version [GuessClVersion [lindex $compilestr 0]] ! unset compilestr ! } ! set opts {} ! # Exception handling ! if {![string match {} $mvcpp_version] && $mvcpp_version>7} { ! # The exception handling specification switch "/GX" ! # is deprecated in version 8. ! # lappend opts /EHsc ! lappend opts /EHac ! } else { ! lappend opts /GX ! } ! ! # Optimizations ! # ! # Options for VC++ 7 and earlier: ! # Disable optimizations: /Od # Maximum optimization: /Ox # Enable runtime debug checks: /GZ # Optimize for Pentium processor: /G5 # Optimize for Pentium Pro: /G6 ! # ! # Options for VC++ 8: ! # Disable optimizations: /Od ! # Maximum optimization: /Ox ! # Enable stack checks: /GZ ! # Require SSE2 support: /arch:SSE2 ! # Fast (less predictable) floating point: /fp:fast ! # Use portable but insecure lib fcns: /D_CRT_SECURE_NO_DEPRECATE ! # ! if {![string match {} $mvcpp_version] && $mvcpp_version<=7} { ! #lappend opts /GZ ! if {$mvcpp_version<6} { ! lappend opts /Od /G6 ! } else { ! lappend opts /Ox /G6 ! } ! } else { ! #lappend opts /GZ /fp:strict /D_CRT_SECURE_NO_DEPRECATE ! lappend opts /Ox /fp:fast /D_CRT_SECURE_NO_DEPRECATE ! lappend opts /wd4996 ! # /wd4996 disables warnings about deprecated function calls ! } ! $config SetValue program_compiler_c++_option_opt "format \"$opts\"" ! # OR, default optimization: ! # $config SetValue program_compiler_c++_option_opt {} ! # NOTE: If you want good performance, be sure to edit ../options.tcl # or ../local/options.tcl to include the line # Oc_Option Add * Platform cflags {-def NDEBUG}