Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for optimisation and compiling under newer versions of GCC #103

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OBJ = $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRC)))
INCLUDES = -I inc -I /usr/include/cryptopp -I sdk

# C compiler flags (-g -O2 -Wall)
CCFLAGS = -O0 -g -fstack-protector-all -Wall #-non-call-exceptions
CCFLAGS = -Os -g -fstack-protector-all -Wall #-non-call-exceptions
CCFLAGS += $(shell pkg-config --cflags libcurl fuse)
CPPFLAGS = -std=c++0x $(CCFLAGS) -D_GLIBCXX_DEBUG

Expand All @@ -29,7 +29,7 @@ CXX= g++
LIBS =

# compile flags
LDFLAGS = -lcryptopp -lfreeimage -ldb_cxx
LDFLAGS = -lcryptopp -lfreeimage -ldb_cxx
LDFLAGS += $(shell pkg-config --libs libcurl fuse)

megafuse: $(OUT)
Expand Down
4 changes: 2 additions & 2 deletions src/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ Config* Config::getInstance()
void Config::check_variable(int &var,std::string value,std::string name)
{
var=stoi(value);
printf("caricata la variabile %s con il valore %d\n",name.c_str(),var);
printf("Creating the variable %s with value %d\n",name.c_str(),var);

}

void Config::check_variable(std::string &var,std::string value,std::string name)
{
var = value;
printf("caricata la variabile %s con il valore %s\n",name.c_str(),value.c_str());
printf("reating the variable %s with value %s\n",name.c_str(),value.c_str());


}
Expand Down
3 changes: 2 additions & 1 deletion src/file_cache_row.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <cmath>

#include <megaclient.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -69,7 +70,7 @@ int CacheManager::numChunks(size_t pos)
end +=i*ChunkedHash::SEGSIZE;
if(end >= pos) return i;
}
return 8 + ceil(float(pos-end)/(8.0*ChunkedHash::SEGSIZE));
return 8 + std::ceil(float(pos-end)/(8.0*ChunkedHash::SEGSIZE));


}
Expand Down