mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-29 19:37:30 +01:00
Remove unused concatn_doublenull / concatn_fitting_doublenull
This commit is contained in:
parent
46108764d5
commit
cc5657f9c9
39
src/util.c
39
src/util.c
@ -175,42 +175,3 @@ void concatn(int length, char * dst, const char * src) {
|
||||
dst[i]=src[j];
|
||||
dst[i]='\0';
|
||||
}
|
||||
|
||||
/* length is maximum length of dst. dst will always be double-null-terminated if
|
||||
* length > 1 */
|
||||
void concatn_doublenull(int length, char * dst, const char * src) {
|
||||
int i,j;
|
||||
if (length <= 1) return;
|
||||
for (i=0;i<length-2 && (dst[i] || dst[i+1]);i++); /* find end of dst */
|
||||
if (i==length-2) {
|
||||
dst[i]='\0';
|
||||
dst[i+1]='\0';
|
||||
return;
|
||||
}
|
||||
if (i>0) i++;
|
||||
for (j=0;i<length-2 && (src[j] || src[j+1]);i++,j++) dst[i]=src[j];
|
||||
dst[i]='\0';
|
||||
dst[i+1]='\0';
|
||||
}
|
||||
|
||||
/* length is maximum length of dst. dst will always be double-null-terminated if
|
||||
* length > 1, if src won't fit, truncate */
|
||||
void concatn_fitting_doublenull(int length, char * dst, const char * src) {
|
||||
int i,j,k;
|
||||
if (length <= 1) return;
|
||||
for (i=0;i<length-2 && (dst[i] || dst[i+1]);i++); /* find end of dst */
|
||||
if (i==length-2) {
|
||||
dst[i]='\0';
|
||||
dst[i+1]='\0';
|
||||
return;
|
||||
}
|
||||
if (i>0) i++;
|
||||
k = i;
|
||||
for (j=0;i<length-2 && (src[j] || src[j+1]);i++,j++) dst[i]=src[j];
|
||||
|
||||
if (i == length-2 && (src[j] || src[j+1])) {
|
||||
i = k;
|
||||
}
|
||||
dst[i]='\0';
|
||||
dst[i+1]='\0';
|
||||
}
|
||||
|
@ -69,8 +69,6 @@ void make_smpl_chunk(uint8_t * buf, int32_t loop_start, int32_t loop_end);
|
||||
void swap_samples_le(sample *buf, int count);
|
||||
|
||||
void concatn(int length, char * dst, const char * src);
|
||||
void concatn_doublenull(int length, char * dst, const char * src);
|
||||
void concatn_fitting_doublenull(int length, char * dst, const char * src);
|
||||
|
||||
|
||||
/* Simple stdout logging for debugging and regression testing purposes.
|
||||
|
Loading…
x
Reference in New Issue
Block a user