LCOV - code coverage report
Current view: top level - sql/backends/monet5 - sql_fround.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 20 20 100.0 %
Date: 2021-10-13 02:24:04 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /*
       2             :  * This Source Code Form is subject to the terms of the Mozilla Public
       3             :  * License, v. 2.0.  If a copy of the MPL was not distributed with this
       4             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       5             :  *
       6             :  * Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V.
       7             :  */
       8             : 
       9             : #include "monetdb_config.h"
      10             : #include "sql.h"
      11             : #include "mal_instruction.h"
      12             : 
      13             : #define CONCAT_2(a, b)          a##b
      14             : #define CONCAT_3(a, b, c)       a##b##c
      15             : 
      16             : #define NIL(t)                  CONCAT_2(t, _nil)
      17             : #define ISNIL(t)                CONCAT_3(is_, t, _nil)
      18             : #define TPE(t)                  CONCAT_2(TYPE_, t)
      19             : #define GDKmin(t)               CONCAT_3(GDK_, t, _min)
      20             : #define GDKmax(t)               CONCAT_3(GDK_, t, _max)
      21             : #define FUN(a, b)               CONCAT_3(a, _, b)
      22             : 
      23             : #define STRING(a)               #a
      24             : 
      25             : static void
      26           9 : finalize_ouput_copy_sorted_property(bat *res, BAT *bn, BAT *b, str msg, bool nils, BUN q, bool try_copy_sorted)
      27             : {
      28           9 :         if (bn && !msg) {
      29           6 :                 BATsetcount(bn, q);
      30           6 :                 bn->tnil = nils;
      31           6 :                 bn->tnonil = !nils;
      32           6 :                 bn->tkey = BATcount(bn) <= 1;
      33           6 :                 bn->tsorted = ((try_copy_sorted && b->tsorted) || BATcount(bn) <= 1);
      34           6 :                 bn->trevsorted = ((try_copy_sorted && b->trevsorted) || BATcount(bn) <= 1);
      35           6 :                 BBPkeepref(*res = bn->batCacheid);
      36           3 :         } else if (bn)
      37           2 :                 BBPreclaim(bn);
      38           9 : }
      39             : 
      40             : static void
      41           9 : unfix_inputs(int nargs, ...)
      42             : {
      43             :         va_list valist;
      44             : 
      45           9 :         va_start(valist, nargs);
      46          27 :         for (int i = 0; i < nargs; i++) {
      47          18 :                 BAT *b = va_arg(valist, BAT *);
      48          18 :                 if (b)
      49           8 :                         BBPunfix(b->batCacheid);
      50             :         }
      51           9 :         va_end(valist);
      52           9 : }
      53             : 
      54             : #define TYPE flt
      55             : #include "sql_fround_impl.h"
      56             : #undef TYPE
      57             : 
      58             : #define TYPE dbl
      59             : #include "sql_fround_impl.h"
      60             : #undef TYPE

Generated by: LCOV version 1.14