-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
HDFfile *hdf_file;
HDFgroup *hdf_group;
HDFdataset *hdf_dataset;
- int size;
+ size_t size;
int fd;
char * value;
char * buffer;
std::string text = "open failed";
es.text = CORBA::string_dup(text.c_str());
throw SALOME::SALOME_Exception(es);
- };
+ }
hdf_dataset->ReadFromDisk(buffer);
- if ( write(fd,buffer,size) <0) {
+ if ( write(fd,buffer,(unsigned int)size) <0) {
SALOME::ExceptionStruct es;
es.type = SALOME::INTERNAL_ERROR;
std::string text = "write failed";
es.text = CORBA::string_dup(text.c_str());
throw SALOME::SALOME_Exception(es);
- };
+ }
// Close the target file
::close(fd);
}
// For each file we create two groups
- // First group contains file's informations
+ // First group contains file's information
// Second group contains the file
// At the end we create a group and a dataset containing the names
// of all the files.
std::string cp_file_name(comp_file_name);
std::size_t index = cp_file_name.rfind("/");
- if (index != -1)
+ if (index != std::string::npos)
{
file_name = cp_file_name.substr(index+1);
path = cp_file_name.substr(0,index+1);
if(fopen(comp_file_name,"rb") != NULL)
status = "ok";
- // Adding file with is informations
+ // Adding file with its information
Engines::file infos;
infos.file_name = CORBA::string_dup(file_name.c_str());
infos.path = CORBA::string_dup(path.c_str());
std::string cp_file_name(comp_file_name);
std::size_t index = cp_file_name.rfind("/");
- if (index != -1)
+ if (index != std::string::npos)
{
file_name = cp_file_name.substr(index+1);
path = cp_file_name.substr(0,index+1);
throw SALOME::SALOME_Exception(es);
}
- // Adding file with his informations
+ // Adding file with its information
Engines::file infos;
infos.file_name = CORBA::string_dup(file_name.c_str());
infos.path = CORBA::string_dup(path.c_str());
*/
//=============================================================================
void
-Salome_file_i::removeFile(const char* file_name)
+Salome_file_i::removeFile(const char* /*file_name*/)
{
MESSAGE("Salome_file_i::removeFile : NOT YET IMPLEMENTED");
}
Salome_file_i::getFilesInfos() {
Engines::files * infos = new Engines::files();
- infos->length(_fileManaged.size());
+ infos->length((CORBA::ULong)_fileManaged.size());
_t_fileManaged::iterator begin = _fileManaged.begin();
_t_fileManaged::iterator end = _fileManaged.end();
/*!
* CORBA method: try to open the file given. If the file is readable, return
* a positive integer else return 0;
- * \param fileName file name to be transfered
+ * \param fileName file name to be transferred
* \return fileId = positive integer > 0 if open OK.
*/
//=============================================================================
// see Advanced CORBA Programming with C++ pp 187-194
CORBA::Octet *buf;
buf = Engines::fileBlock::allocbuf(FILEBLOCK_SIZE);
- int nbRed = fread(buf, sizeof(CORBA::Octet), FILEBLOCK_SIZE, fp);
- aBlock->replace(nbRed, nbRed, buf, 1); // 1 means give ownership
+ size_t nbRed = fread(buf, sizeof(CORBA::Octet), FILEBLOCK_SIZE, fp);
+ aBlock->replace((CORBA::ULong)nbRed, (CORBA::ULong)nbRed, buf, 1); // 1 means give ownership //!< TODO: conversion from size_t to CORBA::ULong
return aBlock;
}