{
struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
struct pipe_context *pipe = blitter->pipe;
- int i, j, f;
+ unsigned i, j, f;
for (i = 0; i <= PIPE_MASK_RGBA; i++)
for (j = 0; j < 2; j++)
assert(!ctx->has_geometry_shader || ctx->base.saved_gs != INVALID_PTR);
assert(!ctx->has_tessellation || ctx->base.saved_tcs != INVALID_PTR);
assert(!ctx->has_tessellation || ctx->base.saved_tes != INVALID_PTR);
- assert(!ctx->has_stream_out || ctx->base.saved_num_so_targets != ~0);
+ assert(!ctx->has_stream_out || ctx->base.saved_num_so_targets != ~0u);
assert(ctx->base.saved_rs_state != INVALID_PTR);
}
static void blitter_check_saved_fb_state(struct blitter_context_priv *ctx)
{
- assert(ctx->base.saved_fb_state.nr_cbufs != ~0);
+ assert(ctx->base.saved_fb_state.nr_cbufs != ~0u);
}
static void blitter_disable_render_cond(struct blitter_context_priv *ctx)
static void blitter_check_saved_textures(struct blitter_context_priv *ctx)
{
- assert(ctx->base.saved_num_sampler_states != ~0);
- assert(ctx->base.saved_num_sampler_views != ~0);
+ assert(ctx->base.saved_num_sampler_states != ~0u);
+ assert(ctx->base.saved_num_sampler_views != ~0u);
}
static void blitter_restore_textures(struct blitter_context_priv *ctx)
}
#elif defined(PIPE_OS_UNIX) && defined(_SC_NPROCESSORS_ONLN)
util_cpu_caps.nr_cpus = sysconf(_SC_NPROCESSORS_ONLN);
- if (util_cpu_caps.nr_cpus == -1)
+ if (util_cpu_caps.nr_cpus == ~0u)
util_cpu_caps.nr_cpus = 1;
#elif defined(PIPE_OS_BSD)
{
util_format_is_float(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
- unsigned i;
+ int i;
assert(desc);
if (!desc) {
}
i = util_format_get_first_non_void_channel(format);
- if (i == -1) {
+ if (i < 0) {
return FALSE;
}
h = MIN2(h, fb->zsbuf->height);
}
- if (w == ~0) {
+ if (w == ~0u) {
*width = 0;
*height = 0;
return FALSE;
pipe_linear_to_tile(size_t src_stride, const void *src_ptr,
struct pipe_tile_info *t, void *dst_ptr)
{
- int x, y, z;
+ unsigned x, y, z;
char *ptr;
size_t bytes = t->cols * t->block.size;
char *dst_ptr2 = (char *) dst_ptr;
assert(pipe_linear_check_tile(t));
- /* lets write lineary to the tiled buffer */
+ /* lets write linearly to the tiled buffer */
for (y = 0; y < t->tiles_y; y++) {
for (x = 0; x < t->tiles_x; x++) {
/* this inner loop could be replace with SSE magic */
void pipe_linear_from_tile(struct pipe_tile_info *t, const void *src_ptr,
size_t dst_stride, void *dst_ptr)
{
- int x, y, z;
+ unsigned x, y, z;
char *ptr;
size_t bytes = t->cols * t->block.size;
const char *src_ptr2 = (const char *) src_ptr;
- /* lets read lineary from the tiled buffer */
+ /* lets read linearly from the tiled buffer */
for (y = 0; y < t->tiles_y; y++) {
for (x = 0; x < t->tiles_x; x++) {
/* this inner loop could be replace with SSE magic */
struct ureg_program *ureg;
struct ureg_src sampler, coord;
struct ureg_dst out, tmp_sum, tmp_coord, tmp;
- int i;
+ unsigned i;
ureg = ureg_create(PIPE_SHADER_FRAGMENT);
if (!ureg)
struct ureg_src sampler, coord;
struct ureg_dst out, tmp, top, bottom;
struct ureg_dst tmp_coord[4], tmp_sum[4];
- int i, c;
+ unsigned i, c;
ureg = ureg_create(PIPE_SHADER_FRAGMENT);
if (!ureg)
util_set_interleaved_vertex_elements(struct cso_context *cso,
unsigned num_elements)
{
- int i;
+ unsigned i;
struct pipe_vertex_element *velem =
calloc(1, num_elements * sizeof(struct pipe_vertex_element));
struct pipe_transfer *transfer;
void *map;
float *pixels = malloc(w * h * 4 * sizeof(float));
- int x,y,e,c;
+ unsigned x,y,e,c;
bool pass = true;
map = pipe_transfer_map(ctx, tex, 0, 0, PIPE_TRANSFER_READ,
mgr->fallback_velems[i].vertex_buffer_index = mgr->fallback_vbs[type];
/* elem_index[type][i] can only be set for one type. */
- assert(type > VB_INSTANCE || elem_index[type+1][i] == ~0);
- assert(type > VB_VERTEX || elem_index[type+2][i] == ~0);
+ assert(type > VB_INSTANCE || elem_index[type+1][i] == ~0u);
+ assert(type > VB_VERTEX || elem_index[type+2][i] == ~0u);
break;
}
}
/* Unreference the now-unused VBOs. */
for (i = 0; i < VB_NUM; i++) {
unsigned vb = mgr->fallback_vbs[i];
- if (vb != ~0) {
+ if (vb != ~0u) {
pipe_resource_reference(&mgr->real_vertex_buffer[vb].buffer, NULL);
mgr->fallback_vbs[i] = ~0;
if (u_vbuf_need_minmax_index(mgr)) {
int max_index;
- if (new_info.max_index != ~0) {
+ if (new_info.max_index != ~0u) {
min_index = new_info.min_index;
max_index = new_info.max_index;
} else {