From 192e8f89ad5c59a66d11616b90a2de78d870b89b Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 29 Dec 2014 23:34:20 +0000 Subject: [PATCH] misc: add a test .ycm_extra_conf.py file for YouCompleteMe. --- .gitignore | 1 + .ycm_extra_conf.py | 33 +++++++++++++++++++++++++++++++++ src/lol/image/image.h | 5 ++++- src/lol/math/half.h | 3 +++ src/lol/math/real.h | 2 ++ src/lol/math/vector.h | 4 +++- 6 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 .ycm_extra_conf.py diff --git a/.gitignore b/.gitignore index e51035af..7e83037a 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ perf.data* # Editor cruft .*.swp *~ +.ycm_extra_conf.pyc # Visual Studio cruft *.vcxproj.user *.csproj.user diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py new file mode 100644 index 00000000..bd504c41 --- /dev/null +++ b/.ycm_extra_conf.py @@ -0,0 +1,33 @@ +import os +import ycm_core + +flags = [ + '-xc++', + '-std=c++11', + # Engine includes + '-I.', + '-I..', + '-Isrc', + # System includes + '-I/usr/include/SDL2', + '-I/usr/include/GL', + '-I/usr/include/libdrm', + '-I/usr/include/libpng15', + # Macros + '-DHAVE_CONFIG_H', + '-D_REENTRANT', +] + +def FlagsForFile(filename, **kwargs): + + extension = os.path.splitext(filename)[1] + if extension not in [ 'cpp', 'h' ]: + return None + + final_flags = flags + + return { + 'flags': final_flags, + 'do_cache': True + } + diff --git a/src/lol/image/image.h b/src/lol/image/image.h index be45b1cc..cc5ed872 100644 --- a/src/lol/image/image.h +++ b/src/lol/image/image.h @@ -84,10 +84,12 @@ public: WrapMode GetWrapY() const; void SetWrap(WrapMode wrap_x, WrapMode wrap_y); + /* Lock continuous arrays of pixels for writing */ template typename PixelType::type *Lock(); void *Lock(); void Unlock(void const *pixels); + /* Lock 2D arrays of pixels for writing */ template inline array2d::type> &Lock2D() { @@ -96,8 +98,9 @@ public: } template - void Unlock2D(array2d const &); + void Unlock2D(array2d const &); + /* XXX: this does not belong here */ bool RetrieveTiles(array& tiles) const; /* Image processing kernels */ diff --git a/src/lol/math/half.h b/src/lol/math/half.h index 21c3b634..9e538d23 100644 --- a/src/lol/math/half.h +++ b/src/lol/math/half.h @@ -15,6 +15,9 @@ // -------------- // +#include + +#include #include #include diff --git a/src/lol/math/real.h b/src/lol/math/real.h index eb7bc0d0..c4007cd1 100644 --- a/src/lol/math/real.h +++ b/src/lol/math/real.h @@ -15,6 +15,8 @@ // -------------- // +#include + #include namespace lol diff --git a/src/lol/math/vector.h b/src/lol/math/vector.h index c47f7803..61459f11 100644 --- a/src/lol/math/vector.h +++ b/src/lol/math/vector.h @@ -15,6 +15,8 @@ // ------------------ // +#include +#include #include #include #include @@ -199,7 +201,7 @@ private: } \ \ void printf() const; \ - String tostring() const; + class String tostring() const; /* * 2-element vectors