MCPcopy Create free account
hub / github.com/Singular/Singular / _omCheckList

Function _omCheckList

omalloc/omList.c:178–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176#include "omDebug.h"
177
178omError_t _omCheckList(void* list, int next, int level, omError_t report, OM_FLR_DECL)
179{
180 if (level < 1) return omError_NoError;
181
182 if (level == 1)
183 {
184 while (list != NULL)
185 {
186 omCheckReturn(omCheckPtr(list, report, OM_FLR_VAL));
187 ITER(list);
188 }
189 }
190 else
191 {
192 void* l1 = list;
193 void* l2;
194 int l = 0, i;
195
196 l1 = list;
197 while (l1 != NULL)
198 {
199 omCheckReturn(omCheckPtr(l1, report, OM_FLR_VAL));
200 i = 0;
201 l2 = list;
202 while (l1 != l2)
203 {
204 i++;
205 ITER(l2);
206 }
207 if (i != l)
208 return omReportError(omError_ListCycleError, report, OM_FLR_VAL, "");
209 ITER(l1);
210 l++;
211 }
212 }
213 return omError_NoError;
214}
215
216omError_t _omCheckSortedList(void* list, int next, int long_field, int level, omError_t report, OM_FLR_DECL)
217{

Callers

nothing calls this directly

Calls 2

omCheckPtrFunction · 0.85
omReportErrorFunction · 0.85

Tested by

no test coverage detected