diff --git a/src/gasman.c b/src/gasman.c index bdb5b7846c..34db4e1c05 100644 --- a/src/gasman.c +++ b/src/gasman.c @@ -115,6 +115,7 @@ #include #include +#include /**************************************************************************** @@ -1362,7 +1363,7 @@ UInt ResizeBag ( SET_PTR_BAG(bag, dst); /* copy the contents of the bag */ - memmove((void *)dst, (void *)DATA(header), + SyMemmove((void *)dst, (void *)DATA(header), sizeof(Obj) * WORDS_BAG(old_size)); } @@ -1884,7 +1885,7 @@ UInt CollectBags ( /* Otherwise do the default thing */ else if ( dst != DATA(header) ) { - memmove(dst, DATA(header), (end - DATA(header))*sizeof(Bag)); + SyMemmove(dst, DATA(header), (end - DATA(header))*sizeof(Bag)); dst += end - DATA(header); } else { @@ -2024,7 +2025,7 @@ UInt CollectBags ( i = SpaceBetweenPointers(EndBags,stopBags)/7 - (SizeMptrsArea-NrLiveBags); /* move the bags area */ - memmove(OldBags+i, OldBags, SizeAllBagsArea*sizeof(*OldBags)); + SyMemmove(OldBags+i, OldBags, SizeAllBagsArea*sizeof(*OldBags)); /* update the masterpointers */ for ( p = MptrBags; p < OldBags; p++ ) { diff --git a/src/listfunc.c b/src/listfunc.c index 33ca81dc7b..c85d3b3560 100644 --- a/src/listfunc.c +++ b/src/listfunc.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #ifdef HPCGAP @@ -100,7 +101,7 @@ void AddPlist3 ( if (pos <= len) { GROW_PLIST(list, len+1); SET_LEN_PLIST(list, len+1); - memmove(ADDR_OBJ(list) + pos+1, + SyMemmove(ADDR_OBJ(list) + pos+1, CONST_ADDR_OBJ(list) + pos, (size_t)(sizeof(Obj)*(len - pos + 1))); } @@ -288,7 +289,7 @@ Obj FuncAPPEND_LIST_INTR ( GROW_STRING(list1, len1 + len2); SET_LEN_STRING(list1, len1 + len2); CLEAR_FILTS_LIST(list1); - memmove( CHARS_STRING(list1) + len1, CHARS_STRING(list2), len2 + 1); + SyMemmove( CHARS_STRING(list1) + len1, CHARS_STRING(list2), len2 + 1); /* ensure trailing zero */ *(CHARS_STRING(list1) + len1 + len2) = 0; return (Obj) 0; @@ -1623,7 +1624,7 @@ Obj FuncCOPY_LIST_ENTRIES( Obj self, Obj args ) GROW_PLIST(srclist, srcmax); if (srcinc == 1 && dstinc == 1) { - memmove(ADDR_OBJ(dstlist) + dststart, + SyMemmove(ADDR_OBJ(dstlist) + dststart, CONST_ADDR_OBJ(srclist) + srcstart, (size_t) number*sizeof(Obj)); } diff --git a/src/opers.c b/src/opers.c index 17899bd843..2907e50e61 100644 --- a/src/opers.c +++ b/src/opers.c @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef HPCGAP #include @@ -1991,7 +1992,7 @@ static ALWAYS_INLINE Obj GetMethodCached(Obj oper, Obj buf[cacheEntrySize]; memcpy(buf, cache + i, sizeof(Obj) * cacheEntrySize); - memmove(cache + target + cacheEntrySize, + SyMemmove(cache + target + cacheEntrySize, cache + target, sizeof(Obj) * (i - target)); memcpy(cache + target, buf, @@ -2017,7 +2018,7 @@ CacheMethod(Obj oper, UInt n, Int prec, Obj * ids, Obj method) UInt cacheEntrySize = n + 2; Bag cacheBag = GET_METHOD_CACHE(oper, n); Obj * cache = 1 + prec * cacheEntrySize + ADDR_OBJ(cacheBag); - memmove(cache + cacheEntrySize, cache, + SyMemmove(cache + cacheEntrySize, cache, sizeof(Obj) * (CACHE_SIZE - prec - 1) * cacheEntrySize); cache[0] = method; cache[1] = INTOBJ_INT(prec); diff --git a/src/permutat.c b/src/permutat.c index d6e4dd1370..d237e27993 100644 --- a/src/permutat.c +++ b/src/permutat.c @@ -52,6 +52,7 @@ #include #include #include +#include #include /**************************************************************************** @@ -4443,12 +4444,12 @@ Obj FuncSCR_SIFT_HELPER(Obj self, Obj S, Obj g, Obj n) /* Copy g into the buffer */ if (IS_PERM2(g) && useP2) { UInt2 * ptR = ADDR_PERM2(result); - memmove(ptR, CONST_ADDR_PERM2(g),2*dg); + SyMemmove(ptR, CONST_ADDR_PERM2(g),2*dg); for ( i = dg; i < nn; i++) ptR[i] = (UInt2)i; } else if (IS_PERM4(g) && !useP2) { UInt4 *ptR = ADDR_PERM4(result); - memmove(ptR,CONST_ADDR_PERM4(g),4*dg); + SyMemmove(ptR,CONST_ADDR_PERM4(g),4*dg); for ( i = dg; i #include #include +#include /**************************************************************************** @@ -449,7 +450,7 @@ Obj FuncADD_SET ( { Obj *ptr; ptr = PTR_BAG(set); - memmove(ptr + pos+1, ptr+pos, sizeof(Obj)*(len+1-pos)); + SyMemmove(ptr + pos+1, ptr+pos, sizeof(Obj)*(len+1-pos)); } SET_ELM_PLIST( set, pos, obj ); CHANGED_BAG( set ); diff --git a/src/system.c b/src/system.c index 1a5ba936a8..40bb062729 100644 --- a/src/system.c +++ b/src/system.c @@ -2006,7 +2006,7 @@ void InitSystem ( const UInt pathlen = strlen(SyGapRootPaths[i]); if (SyGapRootPaths[i][0] == '~' && userhomelen + pathlen < sizeof(SyGapRootPaths[i])) { - memmove(SyGapRootPaths[i] + userhomelen, + SyMemmove(SyGapRootPaths[i] + userhomelen, /* don't copy the ~ but the trailing '\0' */ SyGapRootPaths[i] + 1, pathlen); memcpy(SyGapRootPaths[i], userhome, userhomelen);