LCOV - code coverage report
Current view: top level - sql/backends/monet5 - sql_fround.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 19 21 90.5 %
Date: 2024-04-26 00:35:57 Functions: 2 2 100.0 %

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

Generated by: LCOV version 1.14