diff --git a/src/util/crc32.c b/src/util/crc32.c index 425046ab5fd..ec5ad2cc94c 100644 --- a/src/util/crc32.c +++ b/src/util/crc32.c @@ -28,7 +28,7 @@ /** * @file * CRC32 implementation. - * + * * @author Jose Fonseca */ @@ -39,71 +39,71 @@ #include "crc32.h" -static const uint32_t +static const uint32_t util_crc32_table[256] = { - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, - 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, - 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, - 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, - 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, - 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, - 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, - 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, - 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, - 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, - 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, - 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, - 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, - 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, - 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, - 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, - 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, - 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, - 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, - 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, - 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, - 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, - 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, - 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, - 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, - 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, - 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, - 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, - 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, - 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, - 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, - 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, - 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, - 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, - 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, - 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, - 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, - 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, - 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, - 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, - 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, - 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, - 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, - 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, - 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, - 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, - 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, - 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, - 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, - 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, - 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, - 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, - 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, - 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, - 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, - 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, - 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, - 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, - 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; @@ -116,7 +116,7 @@ util_hash_crc32(const void *data, size_t size) { const uint8_t *p = data; uint32_t crc = 0xffffffff; - + #ifdef HAVE_ZLIB /* Prefer zlib's implementation for better performance. * zlib's uInt is always "unsigned int" while size_t can be 64bit. @@ -129,6 +129,6 @@ util_hash_crc32(const void *data, size_t size) while (size--) crc = util_crc32_table[(crc ^ *p++) & 0xff] ^ (crc >> 8); - + return crc; } diff --git a/src/util/crc32.h b/src/util/crc32.h index b6a21f41705..3ddfc16f414 100644 --- a/src/util/crc32.h +++ b/src/util/crc32.h @@ -28,7 +28,7 @@ /** * @file * CRC32 function. - * + * * @author Jose Fonseca */ @@ -43,7 +43,7 @@ extern "C" { #endif - + uint32_t util_hash_crc32(const void *data, size_t size); diff --git a/src/util/driconf.h b/src/util/driconf.h index 115430226e8..fc720374554 100644 --- a/src/util/driconf.h +++ b/src/util/driconf.h @@ -15,11 +15,11 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * */ /** * \file driconf.h diff --git a/src/util/format/u_format.h b/src/util/format/u_format.h index 0943a80f46d..307cd98bad4 100644 --- a/src/util/format/u_format.h +++ b/src/util/format/u_format.h @@ -105,7 +105,7 @@ struct util_format_block { /** Block width in pixels */ unsigned width; - + /** Block height in pixels */ unsigned height; @@ -483,7 +483,7 @@ util_format_is_plain(enum pipe_format format) return desc->layout == UTIL_FORMAT_LAYOUT_PLAIN ? TRUE : FALSE; } -static inline boolean +static inline boolean util_format_is_compressed(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); @@ -508,7 +508,7 @@ util_format_is_compressed(enum pipe_format format) } } -static inline boolean +static inline boolean util_format_is_s3tc(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); @@ -534,7 +534,7 @@ util_format_is_etc(enum pipe_format format) return desc->layout == UTIL_FORMAT_LAYOUT_ETC ? TRUE : FALSE; } -static inline boolean +static inline boolean util_format_is_srgb(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); @@ -1592,14 +1592,14 @@ util_format_write_4(enum pipe_format format, void util_format_read_4ub(enum pipe_format format, - uint8_t *dst, unsigned dst_stride, - const void *src, unsigned src_stride, + uint8_t *dst, unsigned dst_stride, + const void *src, unsigned src_stride, unsigned x, unsigned y, unsigned w, unsigned h); void util_format_write_4ub(enum pipe_format format, - const uint8_t *src, unsigned src_stride, - void *dst, unsigned dst_stride, + const uint8_t *src, unsigned src_stride, + void *dst, unsigned dst_stride, unsigned x, unsigned y, unsigned w, unsigned h); void diff --git a/src/util/format/u_format_pack.py b/src/util/format/u_format_pack.py index 2ef33f9de24..2a8610548fa 100644 --- a/src/util/format/u_format_pack.py +++ b/src/util/format/u_format_pack.py @@ -70,7 +70,7 @@ def generate_format_type(format): '''Generate a structure that describes the format.''' assert format.layout == PLAIN - + def generate_bitfields(channels, swizzles): for channel in channels: if channel.type == VOID: @@ -127,7 +127,7 @@ def generate_format_type(format): def is_format_supported(format): - '''Determines whether we actually have the plumbing necessary to generate the + '''Determines whether we actually have the plumbing necessary to generate the to read/write to/from this format.''' # FIXME: Ideally we would support any format combination here. @@ -276,7 +276,7 @@ def clamp_expr(src_channel, dst_channel, dst_native_type, value): src_max = src_channel.max() dst_min = dst_channel.min() dst_max = dst_channel.max() - + # Translate the destination range to the src native value dst_min_native = native_to_constant(src_channel, value_to_native(src_channel, dst_min)) dst_max_native = native_to_constant(src_channel, value_to_native(src_channel, dst_max)) @@ -286,18 +286,18 @@ def clamp_expr(src_channel, dst_channel, dst_native_type, value): if src_max > dst_max: return 'MIN2(%s, %s)' % (value, dst_max_native) - + if src_min < dst_min: return 'MAX2(%s, %s)' % (value, dst_min_native) return value -def conversion_expr(src_channel, - dst_channel, dst_native_type, - value, - clamp=True, - src_colorspace = RGB, +def conversion_expr(src_channel, + dst_channel, dst_native_type, + value, + clamp=True, + src_colorspace = RGB, dst_colorspace = RGB): '''Generate the expression to convert a value between two types.''' @@ -436,14 +436,14 @@ def generate_unpack_kernel(format, dst_channel, dst_native_type): if not is_format_supported(format): return - + assert format.layout == PLAIN def unpack_from_bitmask(channels, swizzles): depth = format.block_size() - print(' uint%u_t value = *(const uint%u_t *)src;' % (depth, depth)) + print(' uint%u_t value = *(const uint%u_t *)src;' % (depth, depth)) - # Compute the intermediate unshifted values + # Compute the intermediate unshifted values for i in range(format.nr_channels()): src_channel = channels[i] value = 'value' @@ -479,8 +479,8 @@ def generate_unpack_kernel(format, dst_channel, dst_native_type): # Alpha channel is linear src_colorspace = RGB value = src_channel.name - value = conversion_expr(src_channel, - dst_channel, dst_native_type, + value = conversion_expr(src_channel, + dst_channel, dst_native_type, value, src_colorspace = src_colorspace) elif swizzle == SWIZZLE_0: @@ -492,11 +492,11 @@ def generate_unpack_kernel(format, dst_channel, dst_native_type): else: assert False print(' dst[%u] = %s; /* %s */' % (i, value, 'rgba'[i])) - + def unpack_from_struct(channels, swizzles): print(' struct util_format_%s pixel;' % format.short_name()) print(' memcpy(&pixel, src, sizeof pixel);') - + for i in range(4): swizzle = swizzles[i] if swizzle < 4: @@ -506,8 +506,8 @@ def generate_unpack_kernel(format, dst_channel, dst_native_type): # Alpha channel is linear src_colorspace = RGB value = 'pixel.%s' % src_channel.name - value = conversion_expr(src_channel, - dst_channel, dst_native_type, + value = conversion_expr(src_channel, + dst_channel, dst_native_type, value, src_colorspace = src_colorspace) elif swizzle == SWIZZLE_0: @@ -519,7 +519,7 @@ def generate_unpack_kernel(format, dst_channel, dst_native_type): else: assert False print(' dst[%u] = %s; /* %s */' % (i, value, 'rgba'[i])) - + if format.is_bitmask(): print_channels(format, unpack_from_bitmask) else: @@ -530,7 +530,7 @@ def generate_pack_kernel(format, src_channel, src_native_type): if not is_format_supported(format): return - + dst_native_type = native_type(format) assert format.layout == PLAIN @@ -539,7 +539,7 @@ def generate_pack_kernel(format, src_channel, src_native_type): inv_swizzle = inv_swizzles(swizzles) depth = format.block_size() - print(' uint%u_t value = 0;' % depth) + print(' uint%u_t value = 0;' % depth) for i in range(4): dst_channel = channels[i] @@ -550,8 +550,8 @@ def generate_pack_kernel(format, src_channel, src_native_type): if dst_colorspace == SRGB and inv_swizzle[i] == 3: # Alpha channel is linear dst_colorspace = RGB - value = conversion_expr(src_channel, - dst_channel, dst_native_type, + value = conversion_expr(src_channel, + dst_channel, dst_native_type, value, dst_colorspace = dst_colorspace) if dst_channel.type in (UNSIGNED, SIGNED): @@ -566,14 +566,14 @@ def generate_pack_kernel(format, src_channel, src_native_type): value = None if value is not None: print(' value |= %s;' % (value)) - - print(' *(uint%u_t *)dst = value;' % depth) + + print(' *(uint%u_t *)dst = value;' % depth) def pack_into_struct(channels, swizzles): inv_swizzle = inv_swizzles(swizzles) print(' struct util_format_%s pixel = {0};' % format.short_name()) - + for i in range(4): dst_channel = channels[i] width = dst_channel.size @@ -584,14 +584,14 @@ def generate_pack_kernel(format, src_channel, src_native_type): # Alpha channel is linear dst_colorspace = RGB value ='src[%u]' % inv_swizzle[i] - value = conversion_expr(src_channel, - dst_channel, dst_native_type, - value, + value = conversion_expr(src_channel, + dst_channel, dst_native_type, + value, dst_colorspace = dst_colorspace) print(' pixel.%s = %s;' % (dst_channel.name, value)) - + print(' memcpy(dst, &pixel, sizeof pixel);') - + if format.is_bitmask(): print_channels(format, pack_into_bitmask) else: @@ -620,16 +620,16 @@ def generate_format_unpack(format, dst_channel, dst_native_type, dst_suffix): print(' %s *dst = dst_row;' % (dst_native_type)) print( ' for (unsigned x = 0; x < width; x += %u) {' % (format.block_width,)) - + generate_unpack_kernel(format, dst_channel, dst_native_type) - + print(' src += %u;' % (format.block_size() / 8,)) print(' dst += 4;') print(' }') print('}') print() - + def generate_format_pack(format, src_channel, src_native_type, src_suffix): '''Generate the function to pack pixels to a particular format''' @@ -643,26 +643,26 @@ def generate_format_pack(format, src_channel, src_native_type, src_suffix): print('void util_format_%s_pack_%s(uint8_t *restrict dst_row, unsigned dst_stride, const %s *restrict src_row, unsigned src_stride, unsigned width, unsigned height);' % (name, src_suffix, src_native_type), file=sys.stdout2) - + if is_format_supported(format): print(' unsigned x, y;') print(' for(y = 0; y < height; y += %u) {' % (format.block_height,)) print(' const %s *src = src_row;' % (src_native_type)) print(' uint8_t *dst = dst_row;') print(' for(x = 0; x < width; x += %u) {' % (format.block_width,)) - + generate_pack_kernel(format, src_channel, src_native_type) - + print(' src += 4;') print(' dst += %u;' % (format.block_size() / 8,)) print(' }') print(' dst_row += dst_stride;') print(' src_row += src_stride/sizeof(*src_row);') print(' }') - + print('}') print() - + def generate_format_fetch(format, dst_channel, dst_native_type): '''Generate the function to unpack pixels from a particular format''' @@ -705,7 +705,7 @@ def generate(formats): for format in formats: if not is_format_hand_written(format): - + if is_format_supported(format) and not format.is_bitmask(): generate_format_type(format) @@ -721,20 +721,20 @@ def generate(formats): channel = Channel(SIGNED, False, True, 32) native_type = 'int' suffix = 'signed' - generate_format_pack(format, channel, native_type, suffix) + generate_format_pack(format, channel, native_type, suffix) elif format.is_pure_signed(): native_type = 'int' suffix = 'signed' channel = Channel(SIGNED, False, True, 32) generate_format_unpack(format, channel, native_type, suffix) - generate_format_pack(format, channel, native_type, suffix) + generate_format_pack(format, channel, native_type, suffix) generate_format_fetch(format, channel, native_type) native_type = 'unsigned' suffix = 'unsigned' channel = Channel(UNSIGNED, False, True, 32) - generate_format_pack(format, channel, native_type, suffix) + generate_format_pack(format, channel, native_type, suffix) else: channel = Channel(FLOAT, False, False, 32) native_type = 'float' diff --git a/src/util/format/u_format_rgtc.c b/src/util/format/u_format_rgtc.c index 3be378b1903..9e8b4f0b229 100644 --- a/src/util/format/u_format_rgtc.c +++ b/src/util/format/u_format_rgtc.c @@ -63,7 +63,7 @@ util_format_rgtc1_unorm_unpack_rgba_8unorm(uint8_t *restrict dst_row, unsigned d } void -util_format_rgtc1_unorm_pack_rgba_8unorm(uint8_t *restrict dst_row, unsigned dst_stride, const uint8_t *restrict src_row, +util_format_rgtc1_unorm_pack_rgba_8unorm(uint8_t *restrict dst_row, unsigned dst_stride, const uint8_t *restrict src_row, unsigned src_stride, unsigned width, unsigned height) { const unsigned bw = 4, bh = 4, bytes_per_block = 8; diff --git a/src/util/format/u_format_table.py b/src/util/format/u_format_table.py index 3548a49bb28..a0943f49d8a 100644 --- a/src/util/format/u_format_table.py +++ b/src/util/format/u_format_table.py @@ -140,9 +140,9 @@ def write_format_table(formats): print() write_format_table_header(sys.stdout2) - + u_format_pack.generate(formats) - + def do_channel_array(channels, swizzles): print(" {") for i in range(4): diff --git a/src/util/format/u_format_yuv.h b/src/util/format/u_format_yuv.h index b592d36865c..30dc86f25cb 100644 --- a/src/util/format/u_format_yuv.h +++ b/src/util/format/u_format_yuv.h @@ -68,9 +68,9 @@ util_format_rgb_float_to_yuv(float r, float g, float b, const int _u = scale * (-(0.148f * _r) - (0.291f * _g) + (0.439f * _b)); const int _v = scale * ( (0.439f * _r) - (0.368f * _g) - (0.071f * _b)); - *y = _y + 16; - *u = _u + 128; - *v = _v + 128; + *y = _y + 16; + *u = _u + 128; + *v = _v + 128; } diff --git a/src/util/indices/u_indices.c b/src/util/indices/u_indices.c index d0a5fb8c121..811a6a17473 100644 --- a/src/util/indices/u_indices.c +++ b/src/util/indices/u_indices.c @@ -34,7 +34,7 @@ static void translate_memcpy_ushort( const void *in, { memcpy(out, &((short *)in)[start], out_nr*sizeof(short)); } - + static void translate_memcpy_uint( const void *in, unsigned start, unsigned in_nr, @@ -254,9 +254,9 @@ u_index_generator(unsigned hw_mask, *out_prim = u_index_prim_type_convert(hw_mask, prim, in_pv == out_pv); *out_nr = u_index_count_converted_indices(hw_mask, in_pv == out_pv, prim, nr); - if ((hw_mask & (1< */ diff --git a/src/util/os_time.h b/src/util/os_time.h index c681d6ee3d2..27efdb7e564 100644 --- a/src/util/os_time.h +++ b/src/util/os_time.h @@ -28,7 +28,7 @@ /** * @file * OS independent time-manipulation functions. - * + * * @author Jose Fonseca */ diff --git a/src/util/ptralloc.h b/src/util/ptralloc.h index 019bc7b8e12..f74d8c3645d 100644 --- a/src/util/ptralloc.h +++ b/src/util/ptralloc.h @@ -19,7 +19,7 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. - * + * * Authors: * Mike Blumenkrantz */ diff --git a/src/util/rgtc.c b/src/util/rgtc.c index 6886ac07112..b444e7d7dae 100644 --- a/src/util/rgtc.c +++ b/src/util/rgtc.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2011 Red Hat Inc. - * + * * block compression parts are: * Copyright (C) 2004 Roland Scheidegger All Rights Reserved. * diff --git a/src/util/sha1/README b/src/util/sha1/README index f30acf984e3..445d23716a3 100644 --- a/src/util/sha1/README +++ b/src/util/sha1/README @@ -25,7 +25,7 @@ http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/include/sha1.h?rev=HEAD Notes: - The files should not have any local changes. If there are any they should be clearly documented below and one should aim to upstream them where possible. - + - Files will be periodically syncronised with the respective upstream sources. Updates will be made regularly, but since the code is _not_ aimed as a cryptography solution any issues found should not be considered security ones. diff --git a/src/util/simple_list.h b/src/util/simple_list.h index 5f261612aec..709915b27f7 100644 --- a/src/util/simple_list.h +++ b/src/util/simple_list.h @@ -4,7 +4,7 @@ * * Intended to work with a list sentinal which is created as an empty * list. Insert & delete are O(1). - * + * * \author * (C) 1997, Keith Whitwell */ @@ -159,19 +159,19 @@ do { \ /** * Test whether element is at end of the list. - * + * * \param list list. * \param elem element. - * + * * \return non-zero if element is at end of list, or zero otherwise. */ #define at_end(list, elem) ((elem) == (list)) /** * Test if a list is empty. - * + * * \param list list. - * + * * \return non-zero if list empty, or zero otherwise. */ #define is_empty_list(list) ((list)->next == (list)) @@ -193,7 +193,7 @@ do { \ * * Same as #foreach but lets you unlink the current value during a list * traversal. Useful for freeing a list, element by element. - * + * * \param ptr pointer to the current element. * \param t temporary pointer. * \param list list. diff --git a/src/util/tests/u_qsort_test.cpp b/src/util/tests/u_qsort_test.cpp index a0964e45228..e6c3f0bcf9b 100644 --- a/src/util/tests/u_qsort_test.cpp +++ b/src/util/tests/u_qsort_test.cpp @@ -46,7 +46,7 @@ TEST(u_qsort_test, qsort_test) util_qsort_r(data, GTEST_ARRAY_SIZE_(data), sizeof(data[0]), cmp_func, reinterpret_cast(&ctx)); - + for (size_t i = 0; i < GTEST_ARRAY_SIZE_(data); ++i) { EXPECT_EQ(data[i], i + 1); } diff --git a/src/util/texcompress_rgtc_tmp.h b/src/util/texcompress_rgtc_tmp.h index 6bbae5eadfe..02566b12e7d 100644 --- a/src/util/texcompress_rgtc_tmp.h +++ b/src/util/texcompress_rgtc_tmp.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2011 Red Hat Inc. - * + * * block compression parts are: * Copyright (C) 2004 Roland Scheidegger All Rights Reserved. * diff --git a/src/util/u_atomic.h b/src/util/u_atomic.h index 0bd6a4aaa19..c1936a52e70 100644 --- a/src/util/u_atomic.h +++ b/src/util/u_atomic.h @@ -82,7 +82,7 @@ /* Unlocked version for single threaded environments, such as some * windows kernel modules. */ -#if defined(PIPE_ATOMIC_OS_UNLOCKED) +#if defined(PIPE_ATOMIC_OS_UNLOCKED) #define PIPE_ATOMIC "Unlocked" diff --git a/src/util/u_cpu_detect.c b/src/util/u_cpu_detect.c index 4faaf52703a..6e8743e254f 100644 --- a/src/util/u_cpu_detect.c +++ b/src/util/u_cpu_detect.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Dennis Smit * All Rights Reserved. * @@ -21,7 +21,7 @@ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /** diff --git a/src/util/u_cpu_detect.h b/src/util/u_cpu_detect.h index e89a3e0eef4..a1416d5a3f5 100644 --- a/src/util/u_cpu_detect.h +++ b/src/util/u_cpu_detect.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Dennis Smit * All Rights Reserved. * diff --git a/src/util/u_debug.h b/src/util/u_debug.h index fa14cf100cd..abc3db88dde 100644 --- a/src/util/u_debug.h +++ b/src/util/u_debug.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,16 +22,16 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /** * @file * Cross-platform debugging helpers. - * - * For now it just has assert and printf replacements, but it might be extended - * with stack trace reports and more advanced logging in the near future. - * + * + * For now it just has assert and printf replacements, but it might be extended + * with stack trace reports and more advanced logging in the near future. + * * @author Jose Fonseca */ @@ -62,7 +62,7 @@ extern "C" { #define _util_printf_format(fmt, list) PRINTFLIKE(fmt, list) void _debug_vprintf(const char *format, va_list ap); - + static inline void _debug_printf(const char *format, ...) @@ -164,9 +164,9 @@ debug_get_version_option(const char *name, unsigned *major, unsigned *minor); #ifdef _MSC_VER __declspec(noreturn) #endif -void _debug_assert_fail(const char *expr, - const char *file, - unsigned line, +void _debug_assert_fail(const char *expr, + const char *file, + unsigned line, const char *function) #if defined(__GNUC__) && !defined(DEBUG) __attribute__((noreturn)) @@ -174,10 +174,10 @@ void _debug_assert_fail(const char *expr, ; -/** +/** * Assert macro - * - * Do not expect that the assert call terminates -- errors must be handled + * + * Do not expect that the assert call terminates -- errors must be handled * regardless of assert behavior. * * For non debug builds the assert macro will expand to a no-op, so do not @@ -205,7 +205,7 @@ void _debug_assert_fail(const char *expr, _debug_printf("%s\n", __FUNCTION__) #else #define debug_checkpoint() \ - ((void)0) + ((void)0) #endif @@ -217,7 +217,7 @@ void _debug_assert_fail(const char *expr, _debug_printf("%s:%u:%s\n", __FILE__, __LINE__, __FUNCTION__) #else #define debug_checkpoint_full() \ - ((void)0) + ((void)0) #endif @@ -229,7 +229,7 @@ void _debug_assert_fail(const char *expr, _debug_printf("%s:%u:%s: warning: %s\n", __FILE__, __LINE__, __FUNCTION__, __msg) #else #define debug_warning(__msg) \ - ((void)0) + ((void)0) #endif @@ -248,7 +248,7 @@ void _debug_assert_fail(const char *expr, } while (0) #else #define debug_warn_once(__msg) \ - ((void)0) + ((void)0) #endif @@ -257,7 +257,7 @@ void _debug_assert_fail(const char *expr, */ #ifdef DEBUG #define debug_error(__msg) \ - _debug_printf("%s:%u:%s: error: %s\n", __FILE__, __LINE__, __FUNCTION__, __msg) + _debug_printf("%s:%u:%s: error: %s\n", __FILE__, __LINE__, __FUNCTION__, __msg) #else #define debug_error(__msg) \ _debug_printf("error: %s\n", __msg) @@ -298,7 +298,7 @@ struct debug_named_value /** * Some C pre-processor magic to simplify creating named values. - * + * * Example: * @code * static const debug_named_value my_names[] = { @@ -307,9 +307,9 @@ struct debug_named_value * DEBUG_NAMED_VALUE(MY_ENUM_VALUE_Z), * DEBUG_NAMED_VALUE_END * }; - * + * * ... - * debug_printf("%s = %s\n", + * debug_printf("%s = %s\n", * name, * debug_dump_enum(my_names, my_value)); * ... @@ -324,11 +324,11 @@ struct debug_named_value * Convert a enum value to a string. */ const char * -debug_dump_enum(const struct debug_named_value *names, +debug_dump_enum(const struct debug_named_value *names, unsigned long value); const char * -debug_dump_enum_noprefix(const struct debug_named_value *names, +debug_dump_enum_noprefix(const struct debug_named_value *names, const char *prefix, unsigned long value); @@ -337,7 +337,7 @@ debug_dump_enum_noprefix(const struct debug_named_value *names, * Convert binary flags value to a string. */ const char * -debug_dump_flags(const struct debug_named_value *names, +debug_dump_flags(const struct debug_named_value *names, unsigned long value); @@ -380,14 +380,14 @@ void debug_funclog_enter_exit(const char* f, const int line, const char* file); /** * Get option. - * - * It is an alias for getenv on Linux. - * - * On Windows it reads C:\gallium.cfg, which is a text file with CR+LF line + * + * It is an alias for getenv on Linux. + * + * On Windows it reads C:\gallium.cfg, which is a text file with CR+LF line * endings with one option per line as - * + * * NAME=value - * + * * This file must be terminated with an extra empty line. */ const char * @@ -400,7 +400,7 @@ long debug_get_num_option(const char *name, long dfault); uint64_t -debug_get_flags_option(const char *name, +debug_get_flags_option(const char *name, const struct debug_named_value *flags, uint64_t dfault); diff --git a/src/util/u_debug_stack.c b/src/util/u_debug_stack.c index 9042effc364..87f981f987d 100644 --- a/src/util/u_debug_stack.c +++ b/src/util/u_debug_stack.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * All Rights Reserved. * @@ -75,7 +75,7 @@ symbol_name_cached(unw_cursor_t *cursor, unw_proc_info_t *pip) procname[1] = 0; } - if (asprintf(&name, "%s%s", procname, ret == -UNW_ENOMEM ? "..." : "") == -1) + if (asprintf(&name, "%s%s", procname, ret == -UNW_ENOMEM ? "..." : "") == -1) name = "??"; entry = _mesa_hash_table_insert(symbols_hash, addr, (void*)name); } diff --git a/src/util/u_debug_stack.h b/src/util/u_debug_stack.h index 8a36a66a08e..dadd5426df6 100644 --- a/src/util/u_debug_stack.h +++ b/src/util/u_debug_stack.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,7 +22,7 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ #ifndef U_DEBUG_STACK_H_ @@ -38,7 +38,7 @@ /** * @file * Stack backtracing. - * + * * @author Jose Fonseca */ @@ -57,7 +57,7 @@ extern "C" { * * TODO: This should be refactored as a void * typedef. */ -struct debug_stack_frame +struct debug_stack_frame { #if defined(HAVE_ANDROID_PLATFORM) || defined(HAVE_LIBUNWIND) const char *procname; @@ -73,11 +73,11 @@ struct debug_stack_frame void debug_backtrace_capture(struct debug_stack_frame *backtrace, - unsigned start_frame, + unsigned start_frame, unsigned nr_frames); void -debug_backtrace_dump(const struct debug_stack_frame *backtrace, +debug_backtrace_dump(const struct debug_stack_frame *backtrace, unsigned nr_frames); void diff --git a/src/util/u_debug_symbol.c b/src/util/u_debug_symbol.c index 677159dca40..bf3e8e8150a 100644 --- a/src/util/u_debug_symbol.c +++ b/src/util/u_debug_symbol.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,13 +22,13 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /** * @file * Symbol lookup. - * + * * @author Jose Fonseca */ @@ -42,7 +42,7 @@ #if defined(PIPE_OS_WINDOWS) - + #include #include diff --git a/src/util/u_debug_symbol.h b/src/util/u_debug_symbol.h index b247706c2a0..11621c3b3dd 100644 --- a/src/util/u_debug_symbol.h +++ b/src/util/u_debug_symbol.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,7 +22,7 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ #ifndef U_DEBUG_SYMBOL_H_ @@ -32,7 +32,7 @@ /** * @file * Symbol lookup. - * + * * @author Jose Fonseca */ diff --git a/src/util/u_endian.h b/src/util/u_endian.h index d9ead69a4a4..661628e1822 100644 --- a/src/util/u_endian.h +++ b/src/util/u_endian.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007-2008 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,7 +22,7 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ #ifndef U_ENDIAN_H #define U_ENDIAN_H diff --git a/src/util/u_math.c b/src/util/u_math.c index 7913285a15b..cbeb1324ca2 100644 --- a/src/util/u_math.c +++ b/src/util/u_math.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,7 +22,7 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ @@ -45,7 +45,7 @@ float log2_table[LOG2_TABLE_SIZE]; -static void +static void init_log2_table(void) { unsigned i; diff --git a/src/util/u_math.h b/src/util/u_math.h index 7c989a3963d..d3a062f9e11 100644 --- a/src/util/u_math.h +++ b/src/util/u_math.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,7 +22,7 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ @@ -156,7 +156,7 @@ util_ifloor(float f) static inline int util_iround(float f) { -#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86) +#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86) int r; __asm__ ("fistpl %0" : "=m" (r) : "t" (f) : "st"); return r; diff --git a/src/util/u_memory.h b/src/util/u_memory.h index 621f70c57df..cff7b53ac57 100644 --- a/src/util/u_memory.h +++ b/src/util/u_memory.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,7 +22,7 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ diff --git a/src/util/u_mm.c b/src/util/u_mm.c index 015264fe78c..2e25968bdca 100644 --- a/src/util/u_mm.c +++ b/src/util/u_mm.c @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ @@ -70,14 +70,14 @@ struct mem_block * u_mmInit(int ofs, int size) { struct mem_block *heap, *block; - - if (size <= 0) + + if (size <= 0) return NULL; heap = CALLOC_STRUCT(mem_block); - if (!heap) + if (!heap) return NULL; - + block = CALLOC_STRUCT(mem_block); if (!block) { FREE(heap); @@ -104,8 +104,8 @@ u_mmInit(int ofs, int size) static struct mem_block * -SliceBlock(struct mem_block *p, - int startofs, int size, +SliceBlock(struct mem_block *p, + int startofs, int size, int reserved, UNUSED int alignment) { struct mem_block *newblock; @@ -153,14 +153,14 @@ SliceBlock(struct mem_block *p, newblock->prev_free = p; p->next_free->prev_free = newblock; p->next_free = newblock; - + p->size = size; } /* p = middle block */ p->free = 0; - /* Remove p from the free list: + /* Remove p from the free list: */ p->next_free->prev_free = p->prev_free; p->prev_free->next_free = p->next_free; @@ -203,7 +203,7 @@ u_mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch) break; } - if (p == heap) + if (p == heap) return NULL; assert(p->free); @@ -219,7 +219,7 @@ u_mmFindBlock(struct mem_block *heap, int start) struct mem_block *p; for (p = heap->next; p != heap; p = p->next) { - if (p->ofs == start) + if (p->ofs == start) return p; } @@ -243,9 +243,9 @@ Join2Blocks(struct mem_block *p) p->next = q->next; q->next->prev = p; - q->next_free->prev_free = q->prev_free; + q->next_free->prev_free = q->prev_free; q->prev_free->next_free = q->next_free; - + FREE(q); return 1; } diff --git a/src/util/u_mm.h b/src/util/u_mm.h index 6b158aae6e4..66886febf4c 100644 --- a/src/util/u_mm.h +++ b/src/util/u_mm.h @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ @@ -45,7 +45,7 @@ struct mem_block { -/** +/** * input: total size in bytes * return: a heap pointer if OK, NULL if error */ @@ -61,7 +61,7 @@ extern struct mem_block *u_mmInit(int ofs, int size); * startSearch = linear offset from start of heap to begin search * return: pointer to the allocated block, 0 if error */ -extern struct mem_block *u_mmAllocMem(struct mem_block *heap, int size, int align2, +extern struct mem_block *u_mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch); /** diff --git a/src/util/u_qsort.cpp b/src/util/u_qsort.cpp index 1eb332335af..76f374e4061 100644 --- a/src/util/u_qsort.cpp +++ b/src/util/u_qsort.cpp @@ -46,7 +46,7 @@ util_tls_qsort_r(void *base, size_t nmemb, size_t size, int util_qsort_adapter(void *ctx, const void *elem1, const void *elem2) { - util_qsort_adapter_data *data = + util_qsort_adapter_data *data = reinterpret_cast(ctx); return data->compar(elem1, elem2, data->args); } diff --git a/src/util/u_thread.h b/src/util/u_thread.h index a4215452d35..ec505379fbf 100644 --- a/src/util/u_thread.h +++ b/src/util/u_thread.h @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 1999-2006 Brian Paul * Copyright 2008 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation diff --git a/src/util/u_vector.h b/src/util/u_vector.h index f13fd72ed16..5a1a0893429 100644 --- a/src/util/u_vector.h +++ b/src/util/u_vector.h @@ -21,7 +21,7 @@ * IN THE SOFTWARE. */ -/* +/* * u_vector is a vector based queue for storing arbitrary * sized arrays of objects without using a linked list. */ diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c index d02e5d84677..a824f2f1a87 100644 --- a/src/util/xmlconfig.c +++ b/src/util/xmlconfig.c @@ -15,11 +15,11 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * */ /** * \file xmlconfig.c diff --git a/src/util/xmlconfig.h b/src/util/xmlconfig.h index 302775aecf8..1b2daf857f5 100644 --- a/src/util/xmlconfig.h +++ b/src/util/xmlconfig.h @@ -15,11 +15,11 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * */ /** * \file xmlconfig.h