Menu

What's the return value of IL_LOADFUNC?

chenlee
2003-06-09
2003-06-10
  • chenlee

    chenlee - 2003-06-09

    From il_register.c, IL_LOADFUNC should return IL_NO_ERROR if no error occured.

    But in documentation, IL_LOADFUNC returns IL_TRUE if no error. And many file loading functions in DevIL 1.6.5 source codes do this wrong thing.

     
    • chenlee

      chenlee - 2003-06-09

      Codes from il_register.c :

      ILboolean iRegisterLoad(const ILstring FileName)
      {
          ...
         

          Error = TempNode->Load(FileName);
          if (Error == IL_NO_ERROR || Error == 0) {  // 0 and IL_NO_ERROR are both valid.
              return IL_TRUE;
          }
          else {
              ilSetError(Error);
              return IL_FALSE;
          }
              }
              TempNode = TempNode->Next;
          }
         
          ...
      }

      ==============
      should it be :

      if ( Error == IL_NO_ERROR || Error == IL_TRUE )
      {
      ...
      }

       
    • Denton Woods

      Denton Woods - 2003-06-10

      There are several inconsistencies like this.  I would just recommend using whatever works for you.  It's not about to be changed on you.

       

Log in to post a comment.