From 290aac34d31da6d8080395d5bf1b1cb631fe7b44 Mon Sep 17 00:00:00 2001 From: ponchio Date: Sun, 28 Nov 2004 04:12:04 +0000 Subject: [PATCH] winsockapi include problem --- apps/nexus/file.h | 3 +++ apps/nexus/vfile.h | 15 +++++++++------ apps/nexus/watch.h | 6 ++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/apps/nexus/file.h b/apps/nexus/file.h index 6dda2580..c654ecbd 100644 --- a/apps/nexus/file.h +++ b/apps/nexus/file.h @@ -4,7 +4,10 @@ //TODO move includes in cpp #ifdef WIN32 +#ifndef _WINDOWS_ +#define _WINSOCKAPI_ #include +#endif #else #include #endif diff --git a/apps/nexus/vfile.h b/apps/nexus/vfile.h index 10009154..3fe2ea85 100644 --- a/apps/nexus/vfile.h +++ b/apps/nexus/vfile.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.15 2004/11/18 18:30:14 ponchio +Using baricenters... lotsa changes. + Revision 1.14 2004/10/19 16:50:27 ponchio Added row file access .... @@ -177,14 +180,14 @@ template class VFile: public MFile { } void FlushBuffer(Buffer buffer) { - SetPosition(buffer.key * chunk_size * sizeof(T)); + SetPosition((int64)buffer.key * (int64)chunk_size * (int64)sizeof(T)); WriteBuffer((char *)(buffer.data), buffer.size * sizeof(T)); delete []buffer.data; } void Resize(unsigned int elem) { Flush(); - MFile::Redim(elem * sizeof(T)); + MFile::Redim((int64)elem * (int64)sizeof(T)); n_elements = elem; } @@ -228,7 +231,7 @@ template class VFile: public MFile { index[buffer.key] = buffers.begin(); last_buffer = &*buffers.begin(); - SetPosition(chunk * chunk_size * sizeof(T)); + SetPosition((int64)chunk * (int64)chunk_size * (int64)sizeof(T)); ReadBuffer((char *)(buffer.data), buffer.size * sizeof(T)); return *(buffer.data + offset); @@ -264,19 +267,19 @@ template class VFile: public MFile { buffers.push_front(buffer); index[chunk] = buffers.begin(); - SetPosition(chunk * chunk_size * sizeof(T)); + SetPosition((int64)chunk * (int64)chunk_size * (int64)sizeof(T)); ReadBuffer((char *)(buffer.data), buffer.size * sizeof(T)); return buffer.data; } //non buffered read only acces. T read(unsigned int element) { - SetPosition(element * sizeof(T)); + SetPosition((int64)element * (int64)sizeof(T)); T t; ReadBuffer(&t, sizeof(T)); return t; } void write(unsigned int element, T &t) { - SetPosition(element * sizeof(T)); + SetPosition((int64)element * (int64)sizeof(T)); WriteBuffer(&t, sizeof(T)); } diff --git a/apps/nexus/watch.h b/apps/nexus/watch.h index d3b07b91..57331786 100644 --- a/apps/nexus/watch.h +++ b/apps/nexus/watch.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.3 2004/10/21 13:40:16 ponchio +Debugging. + Revision 1.2 2004/10/21 12:14:02 ponchio Support for mfile (>4Gb) @@ -46,7 +49,10 @@ First draft created. ****************************************************************************/ #ifdef WIN32 +#ifndef _WINDOWS_ +#define _WINSOCKAPI_ #include +#endif #else #include #include