summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: da59d55)
raw | patch | inline | side by side (parent: da59d55)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 29 Jun 2020 18:02:52 +0000 (22:02 +0400) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 29 Jun 2020 18:02:52 +0000 (22:02 +0400) |
Makefile | patch | blob | history | |
main/odcread.cc | patch | blob | history | |
reader/readAlien.cc | patch | blob | history |
diff --git a/Makefile b/Makefile
index 0dbb36af4808f0d829814dcb6fb26e8040308210..b1fac089f138b1ae207a0a16fec379fe5e6e6f2c 100644 (file)
--- a/Makefile
+++ b/Makefile
# * $(MODULE)/*.cc -- module source files
MODULES := main reader store alien typeregister textmodel fold typepath
# * $(MODULE)/*.cc -- module source files
MODULES := main reader store alien typeregister textmodel fold typepath
-CFLAGS = -I.
-CC = g++
+CXXFLAGS = -I.
+CXX = g++
# Variables for the modules to write to
SRCS :=
# Variables for the modules to write to
SRCS :=
# This rule just links the object files together
odcread: $(SRCS:.cc=.o)
# This rule just links the object files together
odcread: $(SRCS:.cc=.o)
- $(CC) -o $@ $^
+ $(CXX) -liconv -o $@ $^
# This rule build an object (.o) from a source (.cc).
%.o: %.cc
# This rule build an object (.o) from a source (.cc).
%.o: %.cc
- $(CC) $(CFLAGS) $< -c -o $@
+ $(CXX) $(CXXFLAGS) $< -c -o $@
# For each implementation header (.ih) generate a dependency (.d) file which
# will ensure that the compiled header (.ih.gch) is rebuilt whenever the header
# For each implementation header (.ih) generate a dependency (.d) file which
# will ensure that the compiled header (.ih.gch) is rebuilt whenever the header
# The .d file is not an explicit target because it will need to be (re-)built
# if and only if the .ih.gch needs to be rebuilt.
%.ih.gch: %.ih
# The .d file is not an explicit target because it will need to be (re-)built
# if and only if the .ih.gch needs to be rebuilt.
%.ih.gch: %.ih
- $(CC) $(CFLAGS) -x c++-header $< -MM -MF $*.d -MP -MT $@
- $(CC) $(CFLAGS) -x c++-header $< -o $@
+ $(CXX) $(CXXFLAGS) -x c++-header $< -MM -MF $*.d -MP -MT $@
+ $(CXX) $(CXXFLAGS) -x c++-header $< -o $@
# Each module has a .ih file that should be *the only* include from the .cc
# files. These .ih files are pre-compiled to .ih.gch, and dependency caching
# Each module has a .ih file that should be *the only* include from the .cc
# files. These .ih files are pre-compiled to .ih.gch, and dependency caching
diff --git a/main/odcread.cc b/main/odcread.cc
index a2a2bd57dca6ec919de8e4918e6916460049a9c0..5dc5b42702246b9fbdeabcd82ee62d3d30091bdf 100644 (file)
--- a/main/odcread.cc
+++ b/main/odcread.cc
// std::cout << s->toPlainText() << std::endl;
// std::cout << std::endl << std::endl;
// std::cout << s->toPlainText() << std::endl;
// std::cout << std::endl << std::endl;
- if (s == nullptr) {
+ if (s == NULL) {
return 1;
}
return 1;
}
diff --git a/reader/readAlien.cc b/reader/readAlien.cc
index ba96ca54e7d45f74bbe11555a9102d69e8786524..1bcec172d9d7d71172d80228404867727c0b3cba 100644 (file)
--- a/reader/readAlien.cc
+++ b/reader/readAlien.cc
namespace odc {
void Reader::readAlien(Alien *alien, std::streampos down, std::streampos end) {
namespace odc {
void Reader::readAlien(Alien *alien, std::streampos down, std::streampos end) {
- std::streampos next = down != 0 ? down : end;
+ std::streampos next = down;
+ if (next == (std::streampos)0) {
+ next = end;
+ }
while (d_rider.tellg() < end) {
if (d_rider.tellg() < next) { // for some reason, this means its a piece (unstructured)
size_t len = next - d_rider.tellg();
while (d_rider.tellg() < end) {
if (d_rider.tellg() < next) { // for some reason, this means its a piece (unstructured)
size_t len = next - d_rider.tellg();