Skip to content
Myr

Merge branch 'master' of https://github.com/MarcoLizza/stb into working

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parents 2805fe3, 41a6bb5 · Browse files · 2 files+13 added−13 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+13 added−13 removed

  • other:+13 added−13 removed

2 files+13 added−13 removed

modified:stb_ds.h+7 added-7 removed
1051 unmodified lines
1052 v0 ^= data;1053 }1054 data = len << (STBDS_SIZE_T_BITS-8);1055 switch (len - i) {1056 case 7: data |= ((size_t) d[6] << 24) << 24;1057 case 6: data |= ((size_t) d[5] << 20) << 20;1058 case 5: data |= ((size_t) d[4] << 16) << 16;1059 case 4: data |= (d[3] << 24);1060 case 3: data |= (d[2] << 16);1061 case 2: data |= (d[1] << 8);1062 case 1: data |= d[0];1056 case 7: data |= ((size_t) d[6] << 24) << 24; // fall through1057 case 6: data |= ((size_t) d[5] << 20) << 20; // fall through1058 case 5: data |= ((size_t) d[4] << 16) << 16; // fall through1059 case 4: data |= (d[3] << 24); // fall through1060 case 3: data |= (d[2] << 16); // fall through1061 case 2: data |= (d[1] << 8); // fall through1062 case 1: data |= d[0]; // fall through1063 case 0: break;1064 }1065 v3 ^= data;1066 for (j=0; j < STBDS_SIPHASH_C_ROUNDS; ++j)
762 unmodified lines
modified:stb_vorbis.c+6 added-6 removed
906 unmodified lines
907908#define array_size_required(count,size) (count*(sizeof(void *)+(size)))909910#define temp_alloc(f,size) (f->alloc.alloc_buffer ? setup_temp_malloc(f,size) : alloca(size))911#define temp_free(f,p) 0911#define temp_free(f,p) (void)0912#define temp_alloc_save(f) ((f)->temp_offset)913#define temp_alloc_restore(f,p) ((f)->temp_offset = (p))914915#define temp_block_array(f,count,size) make_block_array(temp_alloc(f,array_size_required(count,size)), count, size)
2715 unmodified lines
3631 f->vendor = (char*)setup_malloc(f, sizeof(char) * (len+1));3632 for(i=0; i < len; ++i) {3633 f->vendor[i] = get8_packet(f);3634 }3635 f->vendor[len] = (char)NULL;3635 f->vendor[len] = (char)'\0';3636 //user comments3637 f->comment_list_length = get32_packet(f);3638 f->comment_list = (char**)setup_malloc(f, sizeof(char*) * (f->comment_list_length));3639
3 unmodified lines
36433644 for(j=0; j < len; ++j) {3645 f->comment_list[i][j] = get8_packet(f);3646 }3647 f->comment_list[i][len] = (char)NULL;3647 f->comment_list[i][len] = (char)'\0';3648 }36493650 // framing_flag3651 x = get8_packet(f);
316 unmodified lines
3968 for (j=0; j < g->values; ++j)3969 g->sorted_order[j] = (uint8) p[j].id;3970 // precompute the neighbors3971 for (j=2; j < g->values; ++j) {3972 int low,hi;3972 int low = 0,hi = 0;3973 neighbors(g->Xlist, j, &low,&hi);3974 g->neighbors[j][0] = low;3975 g->neighbors[j][1] = hi;3976 }
695 unmodified lines
4672{4673 ProbedPage left, right, mid;4674 int i, start_seg_with_known_loc, end_pos, page_start;4675 uint32 delta, stream_length, padding, last_sample_limit;4676 double offset, bytes_per_sample;4676 double offset = 0.0, bytes_per_sample = 0.0;4677 int probe = 0;46784679 // find the last page and validate the target sample4680 stream_length = stb_vorbis_stream_length_in_samples(f);
543 unmodified lines
5224}52255226int stb_vorbis_get_frame_short(stb_vorbis *f, int num_c, short **buffer, int num_samples)5227{5228 float **output;5228 float **output = NULL;5229 int len = stb_vorbis_get_frame_float(f, NULL, &output);5230 if (len > num_samples) len = num_samples;5231 if (len)5232 convert_samples_short(num_c, buffer, 0, f->channels, output, 0, len);
322 unmodified lines