Ticket #10638: 0001-Fix-64-bit-build-of-Haiku3D.patch

File 0001-Fix-64-bit-build-of-Haiku3D.patch, 3.8 KB (added by bga, 10 years ago)
  • src/apps/haiku3d/RenderView.cpp

    From bfa780c03322141db6a1322a1fa83bc5bef7d83d Mon Sep 17 00:00:00 2001
    From: Bruno Albuquerque <bga@bug-br.org.br>
    Date: Tue, 4 Mar 2014 09:55:53 -0300
    Subject: [PATCH] Fix 64 bit build of Haiku3D.
    
    - Correct prototype for error callback function.
    - Use B_PRI8 macros where needed.
    ---
     src/apps/haiku3d/RenderView.cpp            |  2 +-
     src/apps/haiku3d/RenderView.h              |  2 +-
     src/apps/haiku3d/mesh/StaticMesh.cpp       | 12 ++++++------
     src/apps/haiku3d/texture/BitmapTexture.cpp |  3 ++-
     4 files changed, 10 insertions(+), 9 deletions(-)
    
    diff --git a/src/apps/haiku3d/RenderView.cpp b/src/apps/haiku3d/RenderView.cpp
    index 44f8427..2eea432 100644
    a b RenderView::FrameResized(float width, float height)  
    257257
    258258
    259259void
    260 RenderView::ErrorCallback(uint32 error)
     260RenderView::ErrorCallback(unsigned long error)
    261261{
    262262    fprintf(stderr, "OpenGL error (%li): %s\n", error, gluErrorString(error));
    263263}
  • src/apps/haiku3d/RenderView.h

    diff --git a/src/apps/haiku3d/RenderView.h b/src/apps/haiku3d/RenderView.h
    index 9fcfc88..65e23e2 100644
    a b public:  
    2424
    2525    virtual void    AttachedToWindow();
    2626    virtual void    FrameResized(float width, float height);
    27     virtual void    ErrorCallback(uint32 error);
     27    virtual void    ErrorCallback(unsigned long error);
    2828
    2929protected:
    3030    void            _InitGL();
  • src/apps/haiku3d/mesh/StaticMesh.cpp

    diff --git a/src/apps/haiku3d/mesh/StaticMesh.cpp b/src/apps/haiku3d/mesh/StaticMesh.cpp
    index 16f6fd9..b468226 100644
    a b StaticMesh::_ReadText(const char* fileName)  
    4949        return;
    5050    }
    5151
    52     fscanf(f, "%lu", &fFaceCount);
     52    fscanf(f, "%" B_PRIu32, &fFaceCount);
    5353    fFaces = new Face[fFaceCount];
    5454
    5555    for (uint32 i = 0; i < fFaceCount; i++) {
    5656
    5757        uint32 vertexCount = 0;
    58         fscanf(f, "%lu", &vertexCount);
     58        fscanf(f, "%" B_PRIu32, &vertexCount);
    5959        fFaces[i].vertexCount = vertexCount;
    6060
    6161        for (uint32 vi = 0; vi < vertexCount; vi++) {
    StaticMesh::_ReadText(const char* fileName)  
    6868    }
    6969
    7070    fclose(f);
    71     printf("Mesh::_ReadText, loaded %s (%lu faces)\n", fileName, fFaceCount);
     71    printf("Mesh::_ReadText, loaded %s (%" B_PRIu32 " faces)\n", fileName, fFaceCount);
    7272}
    7373
    7474
    StaticMesh::_WriteBinary(const char* fileName)  
    8989            file.Write(&fFaces[i].v[vi], sizeof(Vertex));
    9090        }
    9191    }
    92     printf("Mesh::_WriteBinary, wrote %s (%lu faces)\n", fileName, fFaceCount);
     92    printf("Mesh::_WriteBinary, wrote %s (%"  B_PRIu32 " faces)\n", fileName, fFaceCount);
    9393}
    9494
    9595
    StaticMesh::_ReadBinary(const char* fileName)  
    111111            file.Read(&fFaces[i].v[vi], sizeof(Vertex));
    112112        }
    113113    }
    114     printf("Mesh::_ReadBinary, loaded %s (%lu faces)\n", fileName, fFaceCount);
     114    printf("Mesh::_ReadBinary, loaded %s (%" B_PRIu32 " faces)\n", fileName, fFaceCount);
    115115}
    116116
    117117
    StaticMesh::_ReadResource(const char* resourceName)  
    146146            memoryIO.Read(&fFaces[i].v[vi], sizeof(Vertex));
    147147        }
    148148    }
    149     printf("Mesh::_ReadResource, loaded %s (%lu faces)\n", resourceName,
     149    printf("Mesh::_ReadResource, loaded %s (%" B_PRIu32 " faces)\n", resourceName,
    150150        fFaceCount);
    151151}
    152152
  • src/apps/haiku3d/texture/BitmapTexture.cpp

    diff --git a/src/apps/haiku3d/texture/BitmapTexture.cpp b/src/apps/haiku3d/texture/BitmapTexture.cpp
    index 654c910..78a4966 100644
    a b BitmapTexture::_Load(BBitmap* bitmap) {  
    4343        0, GL_BGRA, GL_UNSIGNED_BYTE,
    4444        bitmap->Bits());
    4545
    46     printf("BitmapTexture::_Load, loaded texture %u (%li, %li, %libits)\n",
     46    printf("BitmapTexture::_Load, loaded texture %u (%" B_PRId32 ", %" B_PRId32
     47            ", %" B_PRId32 "bits)\n",
    4748        fId, (int32) bitmap->Bounds().Width(),
    4849        (int32) bitmap->Bounds().Height(),
    4950        8 * bitmap->BytesPerRow() / (int)bitmap->Bounds().Width());