~ubuntu-branches/ubuntu/hoary/flac/hoary

« back to all changes in this revision

Viewing changes to src/libFLAC/memory.c

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-04-16 15:14:31 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040416151431-eyloggqxpwbwpogz
Tags: 1.1.0-11
Ensure that libFLAC is linked with -lm on all architectures, and
regardless of whether nasm is present

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* libFLAC - Free Lossless Audio Codec library
2
 
 * Copyright (C) 2001  Josh Coalson
 
2
 * Copyright (C) 2001,2002,2003  Josh Coalson
3
3
 *
4
4
 * This library is free software; you can redistribute it and/or
5
5
 * modify it under the terms of the GNU Library General Public
20
20
#include "private/memory.h"
21
21
#include "FLAC/assert.h"
22
22
 
 
23
#ifdef HAVE_CONFIG_H
 
24
#include <config.h>
 
25
#endif
 
26
 
23
27
void *FLAC__memory_alloc_aligned(size_t bytes, void **aligned_address)
24
28
{
25
29
        void *x;
46
50
        FLAC__ASSERT(0 != aligned_pointer);
47
51
        FLAC__ASSERT(unaligned_pointer != aligned_pointer);
48
52
 
49
 
        pu = (FLAC__int32*)FLAC__memory_alloc_aligned(sizeof(FLAC__int32) * elements, (void*)&pa);
 
53
        pu = (FLAC__int32*)FLAC__memory_alloc_aligned(sizeof(FLAC__int32) * elements, (void**)&pa);
50
54
        if(0 == pu) {
51
55
                return false;
52
56
        }
68
72
        FLAC__ASSERT(0 != aligned_pointer);
69
73
        FLAC__ASSERT(unaligned_pointer != aligned_pointer);
70
74
 
71
 
        pu = (FLAC__uint32*)FLAC__memory_alloc_aligned(sizeof(FLAC__uint32) * elements, (void*)&pa);
 
75
        pu = (FLAC__uint32*)FLAC__memory_alloc_aligned(sizeof(FLAC__uint32) * elements, (void**)&pa);
72
76
        if(0 == pu) {
73
77
                return false;
74
78
        }
90
94
        FLAC__ASSERT(0 != aligned_pointer);
91
95
        FLAC__ASSERT(unaligned_pointer != aligned_pointer);
92
96
 
93
 
        pu = (FLAC__uint64*)FLAC__memory_alloc_aligned(sizeof(FLAC__uint64) * elements, (void*)&pa);
 
97
        pu = (FLAC__uint64*)FLAC__memory_alloc_aligned(sizeof(FLAC__uint64) * elements, (void**)&pa);
94
98
        if(0 == pu) {
95
99
                return false;
96
100
        }
112
116
        FLAC__ASSERT(0 != aligned_pointer);
113
117
        FLAC__ASSERT(unaligned_pointer != aligned_pointer);
114
118
 
115
 
        pu = (unsigned*)FLAC__memory_alloc_aligned(sizeof(unsigned) * elements, (void*)&pa);
 
119
        pu = (unsigned*)FLAC__memory_alloc_aligned(sizeof(unsigned) * elements, (void**)&pa);
116
120
        if(0 == pu) {
117
121
                return false;
118
122
        }
134
138
        FLAC__ASSERT(0 != aligned_pointer);
135
139
        FLAC__ASSERT(unaligned_pointer != aligned_pointer);
136
140
 
137
 
        pu = (FLAC__real*)FLAC__memory_alloc_aligned(sizeof(FLAC__real) * elements, (void*)&pa);
 
141
        pu = (FLAC__real*)FLAC__memory_alloc_aligned(sizeof(FLAC__real) * elements, (void**)&pa);
138
142
        if(0 == pu) {
139
143
                return false;
140
144
        }