Skip to content
Snippets Groups Projects
Commit 58447802 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fixed binary read pb on pure windows (must open files with rb! + more time work

parent 0d8285da
No related branches found
No related tags found
No related merge requests found
// $Id: Timer.cpp,v 1.20 2006-02-25 07:07:29 geuzaine Exp $
// $Id: Timer.cpp,v 1.21 2006-02-25 07:22:11 geuzaine Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
......@@ -47,7 +47,8 @@ double GetTimeInSeconds()
{
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
double t = 1.e2 * (double)ft.dwHighDateTime;
double t = 1.e-1 * (double)ft.dwHighDateTime +
1.e-7 * (double)ft.dwLowDateTime;
return t;
}
......
// $Id: BDS.cpp,v 1.48 2006-01-07 16:20:50 geuzaine Exp $
// $Id: BDS.cpp,v 1.49 2006-02-25 07:22:11 geuzaine Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
......@@ -1291,7 +1291,9 @@ double BDS_Vector::t = 0;
bool BDS_Mesh::read_stl(const char *filename, const double tolerance)
{
FILE *f = fopen(filename, "r");
// add 'b' for pure Windows programs, since some of these files
// contain binary data
FILE *f = fopen(filename, "rb");
if(!f)
return false;
char buffer[256], name[256];
......
// $Id: OpenFile.cpp,v 1.90 2006-02-24 22:07:08 geuzaine Exp $
// $Id: OpenFile.cpp,v 1.91 2006-02-25 07:22:11 geuzaine Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
......@@ -242,7 +242,9 @@ int MergeProblem(char *name, int warn_if_missing)
int status;
FILE *fp;
if(!(fp = fopen(name, "r"))){
// add 'b' for pure Windows programs, since some of these files
// contain binary data
if(!(fp = fopen(name, "rb"))){
if(warn_if_missing)
Msg(WARNING, "Unable to open file '%s'", name);
return 0;
......
......@@ -12,7 +12,11 @@ class GmshInteractiveClient{
{
using_history();
char socket[256];
#if !defined(WIN32) || defined(__CYGWIN__)
sprintf(socket, "%s/.gmshsock", getenv("HOME"));
#else
sprintf(socket, "127.0.0.1:44122");
#endif
if(_client.Connect(socket) < 0) {
printf("Unable to connect to Gmsh\n");
exit(1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment