LCOV - code coverage report
Current view: top level - /mnt/build/buildbot/bld/build-lcov/gcc/m2/gm2-compiler-boot - FifoQueue.c (source / functions) Coverage Total Hit
Test: gcc.info Lines: 86.0 % 43 37
Test Date: 2024-04-20 14:03:02 Functions: 76.9 % 13 10
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : /* do not edit automatically generated by mc from FifoQueue.  */
       2                 :             : /* FifoQueue.mod provides a simple fifo queue.
       3                 :             : 
       4                 :             : Copyright (C) 2001-2024 Free Software Foundation, Inc.
       5                 :             : Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
       6                 :             : 
       7                 :             : This file is part of GNU Modula-2.
       8                 :             : 
       9                 :             : GNU Modula-2 is free software; you can redistribute it and/or modify
      10                 :             : it under the terms of the GNU General Public License as published by
      11                 :             : the Free Software Foundation; either version 3, or (at your option)
      12                 :             : any later version.
      13                 :             : 
      14                 :             : GNU Modula-2 is distributed in the hope that it will be useful, but
      15                 :             : WITHOUT ANY WARRANTY; without even the implied warranty of
      16                 :             : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      17                 :             : General Public License for more details.
      18                 :             : 
      19                 :             : You should have received a copy of the GNU General Public License
      20                 :             : along with GNU Modula-2; see the file COPYING3.  If not see
      21                 :             : <http://www.gnu.org/licenses/>.  */
      22                 :             : 
      23                 :             : #include "config.h"
      24                 :             : #include "system.h"
      25                 :             : #include <stdbool.h>
      26                 :             : #   if !defined (PROC_D)
      27                 :             : #      define PROC_D
      28                 :             :        typedef void (*PROC_t) (void);
      29                 :             :        typedef struct { PROC_t proc; } PROC;
      30                 :             : #   endif
      31                 :             : 
      32                 :             : #define _FifoQueue_H
      33                 :             : #define _FifoQueue_C
      34                 :             : 
      35                 :             : #   include "GLists.h"
      36                 :             : 
      37                 :             : typedef struct FifoQueue_Fifo_r FifoQueue_Fifo;
      38                 :             : 
      39                 :             : struct FifoQueue_Fifo_r {
      40                 :             :                           Lists_List Queue;
      41                 :             :                           unsigned int Out;
      42                 :             :                         };
      43                 :             : 
      44                 :             : static FifoQueue_Fifo const_;
      45                 :             : static FifoQueue_Fifo subrange;
      46                 :             : static FifoQueue_Fifo enumeration;
      47                 :             : static FifoQueue_Fifo constructor;
      48                 :             : 
      49                 :             : /*
      50                 :             :    PutEnumerationIntoFifoQueue - places an enumeration symbol, c,
      51                 :             :                                  into a fifo queue.
      52                 :             : */
      53                 :             : 
      54                 :             : extern "C" void FifoQueue_PutEnumerationIntoFifoQueue (unsigned int c);
      55                 :             : 
      56                 :             : /*
      57                 :             :    GetEnumerationFromFifoQueue - retrieves an enumeration symbol,
      58                 :             :                                  c, from a fifo queue.
      59                 :             : */
      60                 :             : 
      61                 :             : extern "C" void FifoQueue_GetEnumerationFromFifoQueue (unsigned int *c);
      62                 :             : 
      63                 :             : /*
      64                 :             :    PutSubrangeIntoFifoQueue - places a subrange symbol into a fifo
      65                 :             :                               queue.
      66                 :             : */
      67                 :             : 
      68                 :             : extern "C" void FifoQueue_PutSubrangeIntoFifoQueue (unsigned int c);
      69                 :             : 
      70                 :             : /*
      71                 :             :    GetSubrangeFromFifoQueue - retrieves a subrange symbol from a
      72                 :             :                               fifo queue.
      73                 :             : */
      74                 :             : 
      75                 :             : extern "C" void FifoQueue_GetSubrangeFromFifoQueue (unsigned int *c);
      76                 :             : 
      77                 :             : /*
      78                 :             :    PutConstIntoFifoQueue - places a constant symbol
      79                 :             :                            into a fifo queue.
      80                 :             : */
      81                 :             : 
      82                 :             : extern "C" void FifoQueue_PutConstIntoFifoQueue (unsigned int c);
      83                 :             : 
      84                 :             : /*
      85                 :             :    GetConstFromFifoQueue - retrieves a const symbol
      86                 :             :                            from a fifo queue.
      87                 :             : */
      88                 :             : 
      89                 :             : extern "C" void FifoQueue_GetConstFromFifoQueue (unsigned int *c);
      90                 :             : 
      91                 :             : /*
      92                 :             :    PutConstructorIntoFifoQueue - places a constructor symbol
      93                 :             :                                  into a fifo queue.
      94                 :             : */
      95                 :             : 
      96                 :             : extern "C" void FifoQueue_PutConstructorIntoFifoQueue (unsigned int c);
      97                 :             : 
      98                 :             : /*
      99                 :             :    GetConstructorFromFifoQueue - retrieves a constructor symbol
     100                 :             :                                  from a fifo queue.
     101                 :             : */
     102                 :             : 
     103                 :             : extern "C" void FifoQueue_GetConstructorFromFifoQueue (unsigned int *c);
     104                 :             : 
     105                 :             : /*
     106                 :             :    PutInto - places a CARDINAL number, c, into a fifo queue.
     107                 :             : */
     108                 :             : 
     109                 :             : static void PutInto (FifoQueue_Fifo *f, unsigned int c);
     110                 :             : 
     111                 :             : /*
     112                 :             :    GetFrom - retrieves a CARDINAL number, c, from a fifo queue.
     113                 :             : */
     114                 :             : 
     115                 :             : static void GetFrom (FifoQueue_Fifo *f, unsigned int *c);
     116                 :             : 
     117                 :             : /*
     118                 :             :    Init - initialize the fifo queue.
     119                 :             : */
     120                 :             : 
     121                 :             : static void Init (FifoQueue_Fifo *f);
     122                 :             : 
     123                 :             : 
     124                 :             : /*
     125                 :             :    PutInto - places a CARDINAL number, c, into a fifo queue.
     126                 :             : */
     127                 :             : 
     128                 :      202589 : static void PutInto (FifoQueue_Fifo *f, unsigned int c)
     129                 :             : {
     130                 :           0 :   Lists_PutItemIntoList ((*f).Queue, c);
     131                 :           0 : }
     132                 :             : 
     133                 :             : 
     134                 :             : /*
     135                 :             :    GetFrom - retrieves a CARDINAL number, c, from a fifo queue.
     136                 :             : */
     137                 :             : 
     138                 :      202559 : static void GetFrom (FifoQueue_Fifo *f, unsigned int *c)
     139                 :             : {
     140                 :      202559 :   (*f).Out += 1;
     141                 :      202559 :   (*c) = static_cast<unsigned int> (Lists_GetItemFromList ((*f).Queue, (*f).Out));
     142                 :      202559 : }
     143                 :             : 
     144                 :             : 
     145                 :             : /*
     146                 :             :    Init - initialize the fifo queue.
     147                 :             : */
     148                 :             : 
     149                 :       67268 : static void Init (FifoQueue_Fifo *f)
     150                 :             : {
     151                 :           0 :   Lists_InitList (&(*f).Queue);
     152                 :       67268 :   (*f).Out = 0;
     153                 :           0 : }
     154                 :             : 
     155                 :             : 
     156                 :             : /*
     157                 :             :    PutEnumerationIntoFifoQueue - places an enumeration symbol, c,
     158                 :             :                                  into a fifo queue.
     159                 :             : */
     160                 :             : 
     161                 :       21959 : extern "C" void FifoQueue_PutEnumerationIntoFifoQueue (unsigned int c)
     162                 :             : {
     163                 :       21959 :   PutInto (&enumeration, c);
     164                 :       21959 : }
     165                 :             : 
     166                 :             : 
     167                 :             : /*
     168                 :             :    GetEnumerationFromFifoQueue - retrieves an enumeration symbol,
     169                 :             :                                  c, from a fifo queue.
     170                 :             : */
     171                 :             : 
     172                 :       21935 : extern "C" void FifoQueue_GetEnumerationFromFifoQueue (unsigned int *c)
     173                 :             : {
     174                 :       21935 :   GetFrom (&enumeration, c);
     175                 :       21935 : }
     176                 :             : 
     177                 :             : 
     178                 :             : /*
     179                 :             :    PutSubrangeIntoFifoQueue - places a subrange symbol into a fifo
     180                 :             :                               queue.
     181                 :             : */
     182                 :             : 
     183                 :      160042 : extern "C" void FifoQueue_PutSubrangeIntoFifoQueue (unsigned int c)
     184                 :             : {
     185                 :      160042 :   PutInto (&subrange, c);
     186                 :      160042 : }
     187                 :             : 
     188                 :             : 
     189                 :             : /*
     190                 :             :    GetSubrangeFromFifoQueue - retrieves a subrange symbol from a
     191                 :             :                               fifo queue.
     192                 :             : */
     193                 :             : 
     194                 :      160042 : extern "C" void FifoQueue_GetSubrangeFromFifoQueue (unsigned int *c)
     195                 :             : {
     196                 :      160042 :   GetFrom (&subrange, c);
     197                 :      160042 : }
     198                 :             : 
     199                 :             : 
     200                 :             : /*
     201                 :             :    PutConstIntoFifoQueue - places a constant symbol
     202                 :             :                            into a fifo queue.
     203                 :             : */
     204                 :             : 
     205                 :         120 : extern "C" void FifoQueue_PutConstIntoFifoQueue (unsigned int c)
     206                 :             : {
     207                 :         120 :   PutInto (&const_, c);
     208                 :         120 : }
     209                 :             : 
     210                 :             : 
     211                 :             : /*
     212                 :             :    GetConstFromFifoQueue - retrieves a const symbol
     213                 :             :                            from a fifo queue.
     214                 :             : */
     215                 :             : 
     216                 :         120 : extern "C" void FifoQueue_GetConstFromFifoQueue (unsigned int *c)
     217                 :             : {
     218                 :         120 :   GetFrom (&const_, c);
     219                 :         120 : }
     220                 :             : 
     221                 :             : 
     222                 :             : /*
     223                 :             :    PutConstructorIntoFifoQueue - places a constructor symbol
     224                 :             :                                  into a fifo queue.
     225                 :             : */
     226                 :             : 
     227                 :       20468 : extern "C" void FifoQueue_PutConstructorIntoFifoQueue (unsigned int c)
     228                 :             : {
     229                 :       20468 :   PutInto (&constructor, c);
     230                 :       20468 : }
     231                 :             : 
     232                 :             : 
     233                 :             : /*
     234                 :             :    GetConstructorFromFifoQueue - retrieves a constructor symbol
     235                 :             :                                  from a fifo queue.
     236                 :             : */
     237                 :             : 
     238                 :       20462 : extern "C" void FifoQueue_GetConstructorFromFifoQueue (unsigned int *c)
     239                 :             : {
     240                 :       20462 :   GetFrom (&constructor, c);
     241                 :       20462 : }
     242                 :             : 
     243                 :       16817 : extern "C" void _M2_FifoQueue_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
     244                 :             : {
     245                 :       16817 :   Init (&const_);
     246                 :       16817 :   Init (&enumeration);
     247                 :       16817 :   Init (&subrange);
     248                 :       16817 :   Init (&constructor);
     249                 :       16817 : }
     250                 :             : 
     251                 :           0 : extern "C" void _M2_FifoQueue_fini (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
     252                 :             : {
     253                 :           0 : }
        

Generated by: LCOV version 2.1-beta

LCOV profile is generated on x86_64 machine using following configure options: configure --disable-bootstrap --enable-coverage=opt --enable-languages=c,c++,fortran,go,jit,lto,rust,m2 --enable-host-shared. GCC test suite is run with the built compiler.