From: Martin Read Date: Wed, 6 Apr 2011 18:29:54 +0000 (+0100) Subject: Merge branch 'master' of git@github.com:fluffymormegil/libmormegil X-Git-Tag: v1.0.0~3 X-Git-Url: http://git.blackswordsonics.com/?a=commitdiff_plain;h=27f327bcc222ce0d52bc31f19766d37f1a95deac;p=libmormegil Merge branch 'master' of git@github.com:fluffymormegil/libmormegil Conflicts: Makefile include/libmormegil/mathops.hh include/libmormegil/stlprintf.hh --- 27f327bcc222ce0d52bc31f19766d37f1a95deac diff --cc include/libmormegil/abs.hh index dc520a9,0000000..c4863e8 mode 100644,000000..100644 --- a/include/libmormegil/abs.hh +++ b/include/libmormegil/abs.hh @@@ -1,20 -1,0 +1,19 @@@ +// libmormegil/abs.hh +// +// In jurisdictions where this file would be adjuged to contain copyrightable +// material, it is copyright 2011 Martin Read, and released to the public +// under the terms of the Creative Commons Public Domain Dedication (cc-0). +// It is provided without any warranty, express or implied. + +#ifndef libmormegil_abs_hh +#define libmormegil_abs_hh + +namespace libmormegil - { + template inline T abs(const T& i) + { + i < T(0) ? -i : i; + } +} +#endif // libmormegil_abs_hh + +// vim:ts=8:sw=4:expandtab:fo=c diff --cc include/libmormegil/stlprintf.hh index f8b330c,c0931b2..cdeaa21 --- a/include/libmormegil/stlprintf.hh +++ b/include/libmormegil/stlprintf.hh @@@ -1,12 -1,31 +1,12 @@@ - // stlprintf.hh - (v)sprintf-for-STL-strings for Martin's Dungeon Bash -/* stlprintf.hh - (v)sprintf-for-STL-strings for libmormegil - * - * Copyright 2009 Martin Read and Stefan O'Rear - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ ++// stlprintf.hh - (v)sprintf-for-STL-strings +// +// In jurisdictions where this file would be adjuged to contain copyrightable +// material, it is copyright 2011 Martin Read, and released to the public +// under the terms of the Creative Commons Public Domain Dedication (cc-0). +// It is provided without any warranty, express or implied. - #ifndef STLPRINTF_HH - #define STLPRINTF_HH + #ifndef libmormegil_stlprintf_hh + #define libmormegil_stlprintf_hh #include #include @@@ -17,4 -37,4 +17,5 @@@ namespace libmormegi } #endif --/* stlprintf.hh */ ++// vim:ts=8:sw=4:fo=croq ++// stlprintf.hh