Changeset 1598
- Timestamp:
- 12/01/07 10:29:50 (9 months ago)
- Location:
- trunk/source
- Files:
-
- 5 modified
-
cddefines.h (modified) (8 diffs)
-
helike_cs.cpp (modified) (1 diff)
-
hydrocollid.cpp (modified) (2 diffs)
-
lines_service.cpp (modified) (1 diff)
-
lines_service.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/cddefines.h
r1596 r1598 837 837 static const int _nd = lgBC ? 3 : 1; 838 838 T* p[_nd]; // p[0] current pointer, p[1] lower bound, p[2] upper bound 839 void bounds_check(const T* t) const840 { 841 #ifdef _MSC_VER 842 /* disable warning that conditional expression is constant, true or false in if */ 843 # pragma warning( disable : 4127 )844 #endif 845 if (lgBC)839 void _bounds_check( const T* t ) const 840 { 841 #ifdef _MSC_VER 842 /* disable warning that conditional expression is constant, true or false in if */ 843 # pragma warning( disable : 4127 ) 844 #endif 845 if( lgBC ) 846 846 { 847 847 if( t < p[1] || t >= p[2] ) … … 850 850 fprintf( ioQQQ, " ptr = %#lx, valid region: %#lx <= ptr < %#lx\n", 851 851 #ifdef _MSC_VER 852 (size_t)t, (size_t)p[1], (size_t)p[2] );852 (size_t)t, (size_t)p[1], (size_t)p[2] ); 853 853 #else 854 (unsigned long)t, (unsigned long)p[1], (unsigned long)p[2] ); 855 #endif 856 TotalInsanity(); 857 } 858 } 859 } 860 T* index_checked ( const ptrdiff_t n) const 861 { 862 T* t; 863 t = p[0]+n; 864 bounds_check(t); 865 return t; 866 } 867 void set_vals(T* p0, T* p1, T* p2) 868 { 869 #ifdef _MSC_VER 870 /* disable warning that conditional expression is constant, true or false in if */ 871 # pragma warning( disable : 4127 ) 854 (unsigned long)t, (unsigned long)p[1], (unsigned long)p[2] ); 855 #endif 856 TotalInsanity(); 857 } 858 } 859 } 860 T* _index_checked ( const ptrdiff_t n ) const 861 { 862 T* t = p[0]+n; 863 _bounds_check(t); 864 return t; 865 } 866 void _set_vals( T* p0, T* p1, T* p2 ) 867 { 868 #ifdef _MSC_VER 869 /* disable warning that conditional expression is constant, true or false in if */ 870 # pragma warning( disable : 4127 ) 872 871 #endif 873 872 if( lgBC ) … … 882 881 basic_pntr( T* p0, T* p1, T* p2 ) 883 882 { 884 set_vals(p0,p1,p2);883 _set_vals( p0, p1, p2 ); 885 884 } 886 885 basic_pntr( T* p0 ) 887 886 { 888 set_vals(p0,NULL,NULL);887 _set_vals( p0, NULL, NULL ); 889 888 } 890 889 public: 891 890 basic_pntr() 892 891 { 893 set_vals(NULL,NULL,NULL);892 _set_vals( NULL, NULL, NULL ); 894 893 } 895 894 basic_pntr( const basic_pntr& t ) … … 897 896 *this = t; 898 897 } 899 // virtual destructor (in case of destruction via basic_pntr*, see Sutter EC++ p77)900 virtual ~basic_pntr() {};898 // virtual destructor (in case of destruction via basic_pntr*, see Sutter EC++ p77) 899 virtual ~basic_pntr() {}; 901 900 // pre-increment 902 basic_pntr& operator++ ()901 basic_pntr& operator++ () 903 902 { 904 903 ++p[0]; 905 904 return *this; 906 905 } 907 // post-increment908 const basic_pntr operator++ (int)909 { 910 basic_pntr t (*this);911 ++ *this;906 // post-increment 907 const basic_pntr operator++ (int) 908 { 909 basic_pntr t( *this ); 910 ++(*this); 912 911 return t; 913 912 } … … 919 918 } 920 919 // post-decrement 921 const basic_pntr operator-- (int)922 { 923 basic_pntr t (*this);924 -- *this;920 const basic_pntr operator-- (int) 921 { 922 basic_pntr t( *this ); 923 --(*this); 925 924 return t; 926 925 } … … 929 928 // conversion from basic_pntr -> pntr or const_pntr to work; this would also create 930 929 // an implicit and silent conversion from const_pntr -> pntr, which is illegal... 931 basic_pntr& operator+= ( const ptrdiff_t n ) { p[0] += n; return *this; }930 basic_pntr& operator+= ( const ptrdiff_t n ) { p[0] += n; return *this; } 932 931 basic_pntr& operator-= ( const ptrdiff_t n ) { p[0] -= n; return *this; } 933 932 // dereference 934 933 T& operator* () const 935 934 { 936 return *( index_checked(0));935 return *(_index_checked(0)); 937 936 } 938 937 T* operator-> () const 939 938 { 940 return index_checked(0);939 return _index_checked(0); 941 940 } 942 941 T& operator[] ( const ptrdiff_t n ) const 943 942 { 944 return *( index_checked(n));943 return *(_index_checked(n)); 945 944 } 946 945 // finally, define the boolean operators... … … 969 968 const pntr operator+ ( const ptrdiff_t n ) const { pntr s = *this; s += n; return s; } 970 969 const pntr operator- ( const ptrdiff_t n ) const { pntr s = *this; s -= n; return s; } 971 /* const */ptrdiff_t operator- ( const pntr& t ) const { return &(*this[0]) - &t[0]; }970 ptrdiff_t operator- ( const pntr& t ) const { return &(*this[0]) - &t[0]; } 972 971 }; 973 972 … … 1020 1019 const const_pntr operator+ ( const ptrdiff_t n ) const { const_pntr s = *this; s += n; return s; } 1021 1020 const const_pntr operator- ( const ptrdiff_t n ) const { const_pntr s = *this; s -= n; return s; } 1022 /* const */ptrdiff_t operator- ( const const_pntr& t ) const { return &(*this[0]) - &t[0]; }1021 ptrdiff_t operator- ( const const_pntr& t ) const { return &(*this[0]) - &t[0]; } 1023 1022 }; 1024 1023 -
trunk/source/helike_cs.cpp
r1579 r1598 33 33 STATIC double L_mix_integrand_VF01( double alpha ); 34 34 STATIC double StarkCollTransProb_VF01( long int n, long int l, long int lp, double alpha, double deltaPhi); 35 STATIC void helike_collisional_ionization( long nelem );36 35 37 36 static long int global_ipISO, global_n, global_l, global_l_prime, global_s, global_z, global_Collider; -
trunk/source/hydrocollid.cpp
r1579 r1598 37 37 38 38 STATIC realnum OLDHydroCSInterp( long int nelem, long int ipHi, long int ipLo ); 39 STATIC realnum HydroCSInterp( long int nelem, long int ipHi, long int ipLo, long int Collider );39 // STATIC realnum HydroCSInterp( long int nelem, long int ipHi, long int ipLo, long int Collider ); 40 40 41 41 /*HCSAR_interp interpolate on collision strengths */ … … 52 52 /* These are masses relative to the proton mass of the electron, proton, he+, and alpha particle. */ 53 53 static double ColliderMass[4] = {ELECTRON_MASS/PROTON_MASS, 1.0, 4.0, 4.0}; 54 static double ColliderCharge[4] = {1.0, 1.0, 1.0, 2.0};54 // static double ColliderCharge[4] = {1.0, 1.0, 1.0, 2.0}; 55 55 56 56 /*===================================================================================*/ -
trunk/source/lines_service.cpp
r1571 r1598 730 730 731 731 /*PutLine enter local line intensity into the intensity stack for eventual printout */ 732 void PutLine(transition * t, const char *chComment, c har *chLabelTemp)732 void PutLine(transition * t, const char *chComment, const char *chLabelTemp) 733 733 { 734 734 char chLabel[5]; -
trunk/source/lines_service.h
r1499 r1598 74 74 \param *chLabel the line label 75 75 */ 76 void PutLine(transition * t, const char *chComment, c har *chLabel);76 void PutLine(transition * t, const char *chComment, const char *chLabel); 77 77 78 78 /**TexcLine derive excitation temperature of line from contents of line array
