Ignore:
Timestamp:
Mar 19, 2012, 1:59:48 AM (13 years ago)
Author:
イグトランス (egtra)
Message:

egtraブランチの内容をマージ。

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ab5.0/abdev

    • Property svn:ignore set to
      *.opensdf
      *.sdf
      *.suo
      *.user
      int
      ipch
      out
  • trunk/ab5.0/abdev/BasicCompiler_Common/error.cpp

    r562 r828  
    44
    55#define STRING_SYSTEM_DECLAREHANDLE "*_System_DeclareHandle_"
    6 void DifferentTypeError( const Type &varType, const Type &calcFormalType, const int iWarning,const char *pszFuncName,const int ParmNum){
     6void DifferentTypeError(const Type &varType, const Type &calcFormalType, const int iWarning, const char *pszFuncName, const int ParmNum)
     7{
    78    //////////////////////////
    89    // キャストに関する警告
    910    //////////////////////////
    10     char temporary[255];
    11     Type calcType( calcFormalType );
    12 
    13     if(IS_LITERAL(calcType.GetIndex()))
     11    std::ostringstream s;
     12    Type calcType(calcFormalType);
     13
     14    if (IS_LITERAL(calcType.GetIndex()))
    1415    {
    1516        calcType.SetIndex( -1 );
    1617    }
    1718
    18     if(pszFuncName)
    19         sprintf(temporary,"\"%s\"の第%dパラメータが、",pszFuncName,ParmNum+1);
    20     else temporary[0]=0;
    21 
    22     std::string varTypeName = compiler.TypeToString( varType );
    23     if(memcmp( varTypeName.c_str(),STRING_SYSTEM_DECLAREHANDLE,lstrlen(STRING_SYSTEM_DECLAREHANDLE))==0)
    24     {
    25         varTypeName = varTypeName.substr( lstrlen(STRING_SYSTEM_DECLAREHANDLE) );
    26     }
    27 
    28     std::string calcTypeName = compiler.TypeToString( calcType );
    29     if(memcmp( calcTypeName.c_str(),STRING_SYSTEM_DECLAREHANDLE,lstrlen(STRING_SYSTEM_DECLAREHANDLE))==0)
    30     {
    31         calcTypeName = calcTypeName.substr( lstrlen(STRING_SYSTEM_DECLAREHANDLE) );
    32     }
    33     sprintf(temporary+lstrlen(temporary),"%sから%s",calcTypeName.c_str(),varTypeName.c_str());
     19    if (pszFuncName)
     20    {
     21        s << boost::format("\"%s\"の第%dパラメータが、") % pszFuncName % (ParmNum + 1);
     22    }
     23
     24    std::string varTypeName = compiler.TypeToString(varType);
     25    if (memcmp(varTypeName.c_str(), STRING_SYSTEM_DECLAREHANDLE, lstrlen(STRING_SYSTEM_DECLAREHANDLE)) == 0)
     26    {
     27        varTypeName = varTypeName.substr(strlen(STRING_SYSTEM_DECLAREHANDLE));
     28    }
     29
     30    std::string calcTypeName = compiler.TypeToString(calcType);
     31    if (memcmp(calcTypeName.c_str(), STRING_SYSTEM_DECLAREHANDLE, strlen(STRING_SYSTEM_DECLAREHANDLE)) == 0)
     32    {
     33        calcTypeName = calcTypeName.substr(strlen(STRING_SYSTEM_DECLAREHANDLE));
     34    }
     35    s << boost::format("%sから%s") % calcTypeName % varTypeName;
    3436
    3537    extern int cp;
    36     if(iWarning==1) compiler.errorMessenger.Output(-101,temporary,cp);
    37     else if(iWarning==2) compiler.errorMessenger.Output(-102,temporary,cp);
    38     else if(iWarning==3) compiler.errorMessenger.Output(50,temporary,cp);
     38    int errorCode;
     39    switch (iWarning)
     40    {
     41        case 1: errorCode = -101; break;
     42        case 2: errorCode = -102; break;
     43        case 3: errorCode = 50; break;
     44    }
     45    compiler.errorMessenger.Output(errorCode, s.str().c_str(), cp);
    3946}
    4047
Note: See TracChangeset for help on using the changeset viewer.