Changeset 2884 in Sophya for trunk/SophyaLib/BaseTools


Ignore:
Timestamp:
Jan 4, 2006, 2:30:31 PM (20 years ago)
Author:
ansari
Message:

Modifs pour compilation avec g++ 4 (V >= 3.4) - Reza 4 Jan 2006

Location:
trunk/SophyaLib/BaseTools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/datatype.cc

    r2879 r2884  
    3434template <class T>
    3535string DataTypeInfo<T>::getTypeName() { return("???unknowntype???"); }
     36DECL_TEMP_SPEC
    3637string DataTypeInfo<uint_1>::getTypeName() { return("uint_1"); }
     38DECL_TEMP_SPEC
    3739string DataTypeInfo<uint_2>::getTypeName() { return("uint_2"); }
     40DECL_TEMP_SPEC
    3841string DataTypeInfo<int_2>::getTypeName() { return("int_2"); }
     42DECL_TEMP_SPEC
    3943string DataTypeInfo<int_4>::getTypeName() { return("int_4"); }
     44DECL_TEMP_SPEC
    4045string DataTypeInfo<int_8>::getTypeName() { return("int_8"); }
     46DECL_TEMP_SPEC
    4147string DataTypeInfo<uint_4>::getTypeName() { return("uint_4"); }
     48DECL_TEMP_SPEC
    4249string DataTypeInfo<uint_8>::getTypeName() { return("uint_8"); }
     50DECL_TEMP_SPEC
    4351string DataTypeInfo<r_4>::getTypeName() { return("r_4"); }
     52DECL_TEMP_SPEC
    4453string DataTypeInfo<r_8>::getTypeName() { return("r_8"); }
     54DECL_TEMP_SPEC
    4555string DataTypeInfo< complex<r_4> >::getTypeName() { return(" complex<r_4> "); }
     56DECL_TEMP_SPEC
    4657string DataTypeInfo< complex<r_8> >::getTypeName() { return(" complex<r_8> "); }
    4758#endif
  • trunk/SophyaLib/BaseTools/machdefs_mkmf.h

    r2867 r2884  
    222222/*    __KCC__      : KCC, version >= 3.3 is required                   */
    223223/*    __SGICC__    : SGI (IRIX64) CC compiler                          */
     224/*    __INTEL_COMPILER :   : INTEL compiler                            */
     225/*    __IBMCPP__   : AIX (IBM) xlC c++ compiler                        */
    224226
    225227/***********************************************************************/
    226228/* Compiler-specific stuff                                             */
    227229/***********************************************************************/
    228 
    229 /* Some features will be *required* for Planck. Which ones ?               */
    230230 
    231231/*   ANSI_TEMPLATES        : use ANSI syntax for explicit templates        */
     
    245245/*   NO_IOS_COMPLEX        : does not have operator << defined for complex */
    246246/*   DECL_TEMP_SPEC        : Template specialization declaration           */
     247/*   TSNMLUPG4             : Two stage name look-up scheme (g++>3.4)       */
    247248
    248249
     
    269270#endif
    270271
     272/* Most compilers dot not implement two level name lookup for templates
     273   introduced by gcc >= 3.4
     274*/
     275#ifdef TSNMLUPG4
     276#undef TSNMLUPG4
     277#endif
    271278
    272279/* now the specific things */
     
    284291
    285292#ifdef __GNUG__
     293#define GCC_VERSION (__GNUC__ * 10000 \
     294                               + __GNUC_MINOR__ * 100 \
     295                               + __GNUC_PATCHLEVEL__)
    286296#define ANSI_TEMPLATES
    287297/*
     
    294304#define HAS_IOS_BIN
    295305#define HAS_IOS_NOCREATE
     306#if ( GCC_VERSION >= 30000 )
     307#undef  DECL_TEMP_SPEC
     308#define DECL_TEMP_SPEC template <>
     309#endif
     310#if ( GCC_VERSION >= 34000 )
     311/* Two level name look-up scheme for templates introduced from gcc 3.4 */
     312#define TSNMLUPG4
     313#endif
     314
    296315#endif
    297316
  • trunk/SophyaLib/BaseTools/mutyv.cc

    r2826 r2884  
    150150
    151151/* --Methode-- */
     152string & MuTyV::Convert(string & x) const
     153{
     154  if (typ == MTVString)  x = *strv;
     155  else if (typ == MTVTimeStamp) { x = TimeStamp(dv).ToString(); }
     156  else {
     157    char buff[96];
     158    if (typ == MTVInteger)  sprintf(buff,"%ld", (long)iv);
     159    else if (typ == MTVFloat) sprintf(buff,"%g", dv);
     160    else if (typ == MTVComplex) sprintf(buff,"(%g,%g)", dv, dv_im);
     161    else buff[0] = '\0';
     162    x = buff;
     163  }
     164  return x;
     165}
     166
     167/* --Methode-- */
    152168MuTyV::operator TimeStamp() const
    153169{
    154170  return TimeStamp(dv);
     171}
     172
     173/* --Methode-- */
     174TimeStamp& MuTyV::Convert(TimeStamp& x) const
     175{
     176  x = TimeStamp(dv);
     177  return x;
    155178}
    156179
  • trunk/SophyaLib/BaseTools/mutyv.h

    r2826 r2884  
    7777         operator TimeStamp() const ;
    7878
     79  inline uint_2 Convert(uint_2& x) const { x = (uint_2)iv; return x; }
     80  inline uint_4 Convert(uint_4& x) const { x = (uint_4)iv; return x; }
     81  inline uint_8 Convert(uint_8& x) const { x = (uint_8)iv; return x; }
     82  inline int_4 Convert(int_4& x) const { x = (int_4)iv; return x; }
     83  inline int_8 Convert(int_8& x) const { x = iv; return x; }
     84  inline r_4 Convert(r_4& x) const { x = (r_4)dv; return x; }
     85  inline r_8 Convert(r_8& x) const { x = dv; return x; }
     86  inline complex<r_4> Convert(complex<r_4> & x) const
     87    { x = complex< r_4 > ((r_4)dv, (r_4)dv_im); return x; }
     88  inline complex<r_8> Convert(complex<r_8> & x) const
     89    { x = complex< r_8 > (dv, dv_im); return x; }
     90 
     91  string&  Convert(string& x) const ;
     92  TimeStamp& Convert(TimeStamp& x) const ;
     93
    7994  inline MTVType Type() const { return typ; }
    8095  inline int_8   GetIntPart() const { return iv; }
  • trunk/SophyaLib/BaseTools/segdatablock.h

    r2805 r2884  
    9191  {
    9292    SegDataBlock<T> * sdb = dynamic_cast< SegDataBlock<T> *>(&a);
    93     if (p != NULL) {
    94       mSRef = p->mSRef;
     93    if (sdb != NULL) {
     94      mSRef = sdb->mSRef;
    9595      mSRef->nref++;
    9696    }
Note: See TracChangeset for help on using the changeset viewer.