Asterisk - The Open Source Telephony Project  18.5.0
Functions
random.c File Reference
#include "f2c.h"
Include dependency graph for random.c:

Go to the source code of this file.

Functions

integer random_ (struct lpc10_decoder_state *st)
 

Function Documentation

◆ random_()

integer random_ ( struct lpc10_decoder_state st)

Definition at line 93 of file random.c.

References lpc10_decoder_state::j, lpc10_decoder_state::k, and lpc10_decoder_state::y.

Referenced by bsynz_().

94 {
95  /* Initialized data */
96 
97  integer *j;
98  integer *k;
99  shortint *y;
100 
101  /* System generated locals */
102  integer ret_val;
103 
104 /* Parameters/constants */
105 /* Local state */
106 /* The following is a 16 bit 2's complement addition, */
107 /* with overflow checking disabled */
108 
109  j = &(st->j);
110  k = &(st->k);
111  y = &(st->y[0]);
112 
113  y[*k - 1] += y[*j - 1];
114  ret_val = y[*k - 1];
115  --(*k);
116  if (*k <= 0) {
117  *k = 5;
118  }
119  --(*j);
120  if (*j <= 0) {
121  *j = 5;
122  }
123  return ret_val;
124 } /* random_ */
shortint y[5]
Definition: lpc10.h:189
INT16 shortint
Definition: lpc10.h:82
INT32 integer
Definition: lpc10.h:80