- Timestamp:
- Nov 24, 2021, 9:10:18 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 7770cc8
- Parents:
- fefd77a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/containers/string_res.cfa
rfefd77a r94647b0b 49 49 static void ?{}( VbyteHeap &, size_t = 1000 ); 50 50 static void ^?{}( VbyteHeap & ); 51 static void ByteCopy( char *, int, int, char *, int, int ); // copy a block of bytes from one location in the heap to another 51 52 52 static int ByteCmp( char *, int, int, char *, int, int ); // compare 2 blocks of bytes 53 53 static char *VbyteAlloc( VbyteHeap &, int ); // allocate a block bytes in the heap … … 875 875 //######################### VbyteHeap ######################### 876 876 877 // Move characters from one location in the byte-string area to another. The routine handles the following situations:878 //879 // if the |Src| > |Dst| => truncate880 // if the |Dst| > |Src| => pad Dst with blanks881 882 void ByteCopy( char *Dst, int DstStart, int DstLnth, char *Src, int SrcStart, int SrcLnth ) {883 for ( int i = 0; i < DstLnth; i += 1 ) {884 if ( i == SrcLnth ) { // |Dst| > |Src|885 for ( ; i < DstLnth; i += 1 ) { // pad Dst with blanks886 Dst[DstStart + i] = ' ';887 } // for888 break;889 } // exit890 Dst[DstStart + i] = Src[SrcStart + i];891 } // for892 } // ByteCopy893 894 877 // Compare two byte strings in the byte-string area. The routine returns the following values: 895 878 // … … 955 938 h = Header.flink; // ignore header node 956 939 for (;;) { 957 ByteCopy( EndVbyte, 0, h->lnth, h->s, 0, h->lnth );940 memmove( EndVbyte, h->s, h->lnth ); 958 941 obase = h->s; 959 942 h->s = EndVbyte; … … 997 980 int AmountUsed, AmountFree; 998 981 982 // assert( false ); 983 999 984 AmountUsed = 0; 1000 985 for ( HandleNode *i = Header.flink; i != &Header; i = i->flink ) { // calculate amount of byte area used
Note: See TracChangeset
for help on using the changeset viewer.