Changeset 923a7a8 for src/fvec.c
- Timestamp:
- Nov 26, 2013, 4:44:17 AM (10 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 39a7b26
- Parents:
- 2dbcafa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/fvec.c
r2dbcafa r923a7a8 64 64 65 65 void fvec_zeros(fvec_t *s) { 66 #if HAVE_MEMCPY_HACKS 67 memset(s->data, 0, s->length * sizeof(smpl_t)); 68 #else 66 69 fvec_set(s, 0.); 70 #endif 67 71 } 68 72 … … 87 91 88 92 void fvec_copy(fvec_t *s, fvec_t *t) { 93 if (s->length != t->length) { 94 AUBIO_ERR("trying to copy %d elements to %d elements \n", 95 s->length, t->length); 96 return; 97 } 98 #if HAVE_MEMCPY_HACKS 99 memcpy(t->data, s->data, t->length * sizeof(smpl_t)); 100 #else 89 101 uint_t j; 90 uint_t length = t->length; 91 if (s->length != t->length) { 92 AUBIO_WRN("trying to copy %d elements to %d elements \n", 93 s->length, t->length); 94 length = MIN(s->length, t->length); 95 } 96 for (j=0; j< length; j++) { 102 for (j=0; j< t->length; j++) { 97 103 t->data[j] = s->data[j]; 98 104 } 105 #endif 99 106 }
Note: See TracChangeset
for help on using the changeset viewer.