diff --git a/CMakeLists.txt b/CMakeLists.txt index b570c27..b6363ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,3 +93,8 @@ include(CPack) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) endif () + +add_custom_target( + print_build_type + COMMAND ${CMAKE_COMMAND} -E echo $<$:Undefined>$<$>:$> +) diff --git a/doc/teapot.lyx b/doc/teapot.lyx index cd3ebc0..6ab5ff7 100644 --- a/doc/teapot.lyx +++ b/doc/teapot.lyx @@ -8463,7 +8463,14 @@ l1 l1 \emph default defaults to the current location. - The second form simply returns the number of its arguments which are nonempty. + If any dimension of either location is negative, that component is simply + taken as 0. + In other words, locations off the sheet are considered empty, but it is + not an error to access them. +\begin_inset Newline newline +\end_inset + +The second form simply returns the number of its arguments which are nonempty. \end_layout \begin_layout Description diff --git a/src/common/misc.c b/src/common/misc.c index c3fa89f..a2dbfeb 100644 --- a/src/common/misc.c +++ b/src/common/misc.c @@ -30,16 +30,15 @@ #include "utf8.h" /*}}}*/ -/* posorder -- sort two integers */ /*{{{*/ +/* posorder -- sort two integers, clamping each to be nonnegative. */ /*{{{*/ void posorder(int *x, int *y) { assert(x != (int*)0); - assert(*x >= 0); assert(y != (int*)0); - assert(*y >= 0); + if (*x < 0) *x = 0; + if (*y < 0) *y = 0; - if (*x > *y) - { + if (*x > *y) { int t = *x; *x = *y; *y = t;