mesa/st: enable carry/borrow lowering pass
[mesa.git] / src / mesa / main / vdpau.c
index e21a26b433df61a4bbfb1038fc7d79338502dc06..d9745939391cf50a13ad2b7885039447be571598 100644 (file)
@@ -88,7 +88,7 @@ unregister_surface(struct set_entry *entry)
    }
 
    _mesa_set_remove(ctx->vdpSurfaces, entry);
-   FREE(surf);
+   free(surf);
 }
 
 void GLAPIENTRY
@@ -145,7 +145,7 @@ register_surface(struct gl_context *ctx, GLboolean isOutput,
 
       if (tex->Immutable) {
          _mesa_unlock_texture(ctx, tex);
-         FREE(surf);
+         free(surf);
          _mesa_error(ctx, GL_INVALID_OPERATION,
                      "VDPAURegisterSurfaceNV(texture is immutable)");
          return (GLintptr)NULL;
@@ -155,7 +155,7 @@ register_surface(struct gl_context *ctx, GLboolean isOutput,
          tex->Target = target;
       else if (tex->Target != target) {
          _mesa_unlock_texture(ctx, tex);
-         FREE(surf);
+         free(surf);
          _mesa_error(ctx, GL_INVALID_OPERATION,
                      "VDPAURegisterSurfaceNV(target mismatch)");
          return (GLintptr)NULL;
@@ -205,7 +205,7 @@ _mesa_VDPAURegisterOutputSurfaceNV(const GLvoid *vdpSurface, GLenum target,
                            numTextureNames, textureNames);
 }
 
-void GLAPIENTRY
+GLboolean GLAPIENTRY
 _mesa_VDPAUIsSurfaceNV(GLintptr surface)
 {
    struct vdp_surface *surf = (struct vdp_surface *)surface;
@@ -213,13 +213,14 @@ _mesa_VDPAUIsSurfaceNV(GLintptr surface)
 
    if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUIsSurfaceNV");
-      return;
+      return false;
    }
 
    if (!_mesa_set_search(ctx->vdpSurfaces, _mesa_hash_pointer(surf), surf)) {
-      _mesa_error(ctx, GL_INVALID_VALUE, "VDPAUIsSurfaceNV");
-      return;
+      return false;
    }
+
+   return true;
 }
 
 void GLAPIENTRY
@@ -253,7 +254,7 @@ _mesa_VDPAUUnregisterSurfaceNV(GLintptr surface)
    }
 
    _mesa_set_remove(ctx->vdpSurfaces, entry);
-   FREE(surf);
+   free(surf);
 }
 
 void GLAPIENTRY
@@ -324,7 +325,7 @@ void GLAPIENTRY
 _mesa_VDPAUMapSurfacesNV(GLsizei numSurfaces, const GLintptr *surfaces)
 {
    GET_CURRENT_CONTEXT(ctx);
-   int i, j;
+   int i;
 
    if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUUnmapSurfacesNV");
@@ -348,6 +349,7 @@ _mesa_VDPAUMapSurfacesNV(GLsizei numSurfaces, const GLintptr *surfaces)
    for (i = 0; i < numSurfaces; ++i) {
       struct vdp_surface *surf = (struct vdp_surface *)surfaces[i];
       unsigned numTextureNames = surf->output ? 1 : 4;
+      unsigned j;
 
       for (j = 0; j < numTextureNames; ++j) {
          struct gl_texture_object *tex = surf->textures[j];
@@ -377,7 +379,7 @@ void GLAPIENTRY
 _mesa_VDPAUUnmapSurfacesNV(GLsizei numSurfaces, const GLintptr *surfaces)
 {
    GET_CURRENT_CONTEXT(ctx);
-   int i, j;
+   int i;
 
    if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUUnmapSurfacesNV");
@@ -401,6 +403,7 @@ _mesa_VDPAUUnmapSurfacesNV(GLsizei numSurfaces, const GLintptr *surfaces)
    for (i = 0; i < numSurfaces; ++i) {
       struct vdp_surface *surf = (struct vdp_surface *)surfaces[i];
       unsigned numTextureNames = surf->output ? 1 : 4;
+      unsigned j;
 
       for (j = 0; j < numTextureNames; ++j) {
          struct gl_texture_object *tex = surf->textures[j];