Commit 8dc3b275 authored by unknown's avatar unknown
Browse files

bug compilation undex Visual C++

parent 04072a3b
......@@ -29,9 +29,11 @@
#include "Algo/Import/import.h"
#include "Algo/Export/export.h"
using namespace CGoGN ;
int main(int argc, char **argv)
{
// // interface
......@@ -198,7 +200,7 @@ void MyQT::createMap(int n)
{
if (dm.isMarked(d) && (!myMap.isBoundaryMarked(d)))
{
int n = random();
int n = rand();
float r = float(n&0x7f)/255.0f + 0.25f;
float g = float((n>>8)&0x7f)/255.0f + 0.25f;
float b = float((n>>16)&0x7f)/255.0 + 0.25f;
......@@ -276,7 +278,7 @@ void MyQT::cb_keyPress(int keycode)
{
if (!myMap.isBoundaryMarked(d))
{
int n = random();
int n = rand();
float r = float(n&0x7f)/255.0f + 0.25f;
float g = float((n>>8)&0x7f)/255.0f + 0.25f;
float b = float((n>>16)&0x7f)/255.0 + 0.25f;
......@@ -391,7 +393,7 @@ void MyQT::importMesh(std::string& filename)
{
if (dm.isMarked(d) && (!myMap.isBoundaryMarked(d)))
{
int n = random();
int n = rand();
float r = float(n&0x7f)/255.0f + 0.25f;
float g = float((n>>8)&0x7f)/255.0f + 0.25f;
float b = float((n>>16)&0x7f)/255.0 + 0.25f;
......
......@@ -2068,12 +2068,14 @@ void get_binary_item(
{
char c[8];
void *ptr;
short word;
char *byte;
int my_endianness;
ptr = (void *) c;
short int word = 1 ;
char *byte = (char *) &word ;
int my_endianness = byte[0] ? PLY_BINARY_LE : PLY_BINARY_BE ;
ptr = c;
word = 1 ;
byte = (char *) &word ;
my_endianness = byte[0] ? PLY_BINARY_LE : PLY_BINARY_BE ;
switch (type) {
case PLY_Int8:
......@@ -2091,8 +2093,10 @@ void get_binary_item(
case PLY_Int16:
if (my_endianness != file_type)
{
fread (ptr+1, 1, 1, fp);
fread (ptr+0, 1, 1, fp);
unsigned char *cptr;
cptr = (unsigned char*) ptr;
fread (cptr+1, 1, 1, fp);
fread (cptr+0, 1, 1, fp);
}
else
fread (ptr, 2, 1, fp);
......@@ -2103,8 +2107,10 @@ void get_binary_item(
case PLY_Uint16:
if (my_endianness != file_type)
{
fread (ptr+1, 1, 1, fp);
fread (ptr+0, 1, 1, fp);
unsigned char *cptr;
cptr = (unsigned char*) ptr;
fread (cptr+1, 1, 1, fp);
fread (cptr+0, 1, 1, fp);
}
else
fread (ptr, 2, 1, fp);
......@@ -2115,10 +2121,12 @@ void get_binary_item(
case PLY_Int32:
if (my_endianness != file_type)
{
fread (ptr+3, 1, 1, fp);
fread (ptr+2, 1, 1, fp);
fread (ptr+1, 1, 1, fp);
fread (ptr+0, 1, 1, fp);
unsigned char *cptr;
cptr = (unsigned char*) ptr;
fread (cptr+3, 1, 1, fp);
fread (cptr+2, 1, 1, fp);
fread (cptr+1, 1, 1, fp);
fread (cptr+0, 1, 1, fp);
}
else
fread (ptr, 4, 1, fp);
......@@ -2129,10 +2137,12 @@ void get_binary_item(
case PLY_Uint32:
if (my_endianness != file_type)
{
fread (ptr+3, 1, 1, fp);
fread (ptr+2, 1, 1, fp);
fread (ptr+1, 1, 1, fp);
fread (ptr+0, 1, 1, fp);
unsigned char *cptr;
cptr = (unsigned char*) ptr;
fread (cptr+3, 1, 1, fp);
fread (cptr+2, 1, 1, fp);
fread (cptr+1, 1, 1, fp);
fread (cptr+0, 1, 1, fp);
}
else
fread (ptr, 4, 1, fp);
......@@ -2143,10 +2153,12 @@ void get_binary_item(
case PLY_Float32:
if (my_endianness != file_type)
{
fread (ptr+3, 1, 1, fp);
fread (ptr+2, 1, 1, fp);
fread (ptr+1, 1, 1, fp);
fread (ptr+0, 1, 1, fp);
unsigned char *cptr;
cptr = (unsigned char*) ptr;
fread (cptr+3, 1, 1, fp);
fread (cptr+2, 1, 1, fp);
fread (cptr+1, 1, 1, fp);
fread (cptr+0, 1, 1, fp);
}
else
fread (ptr, 4, 1, fp);
......@@ -2157,14 +2169,16 @@ void get_binary_item(
case PLY_Float64:
if (my_endianness != file_type)
{
fread (ptr+7, 1, 1, fp);
fread (ptr+6, 1, 1, fp);
fread (ptr+5, 1, 1, fp);
fread (ptr+4, 1, 1, fp);
fread (ptr+3, 1, 1, fp);
fread (ptr+2, 1, 1, fp);
fread (ptr+1, 1, 1, fp);
fread (ptr+0, 1, 1, fp);
unsigned char *cptr;
cptr = (unsigned char*) ptr;
fread (cptr+7, 1, 1, fp);
fread (cptr+6, 1, 1, fp);
fread (cptr+5, 1, 1, fp);
fread (cptr+4, 1, 1, fp);
fread (cptr+3, 1, 1, fp);
fread (cptr+2, 1, 1, fp);
fread (cptr+1, 1, 1, fp);
fread (cptr+0, 1, 1, fp);
}
else
fread (ptr, 8, 1, fp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment