1. 02 Nov, 2012 1 commit
    • Matt Turner's avatar
      ralloc: Annotate printf functions with PRINTFLIKE(...) · 94cc306e
      Matt Turner authored
      
      
      This is a squash of the following two commits:
      
          ralloc: Annotate printf functions with PRINTFLIKE(...)
      
          Catches problems such as (in the gles3 branch)
      
          glcpp-parse.y: In function '_glcpp_parser_handle_version_declaration':
          glcpp-parse.y:1990:39: warning: format '%lli' expects argument of type
          	'long long int', but argument 4 has type 'int' [-Wformat]
      
          As a side-effect, remove ralloc.c's likely/unlikely macros and just use
          the ones from main/compiler.h.
      
          NOTE: This is a candidate for the release branches.
      Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
          (cherry picked from commit 41b14d12)
      
      and
      
          src/glsl/tests/Makefile.am: Specify -I... in AM_CPPFLAGS
      
          When specifying per-target CFLAGS (e.g., ralloc_test_CFLAGS) AM_CFLAGS
          are not used. AM_CPPFLAGS should be used for includes anyway.
      
          Fixes a build problem since 41b14d12
      
      :
      
          CC       ralloc_test-ralloc.o
          In file included from ../../../src/glsl/ralloc.c:42:0:
          ../../../src/glsl/ralloc.h:57:27: fatal error: main/compiler.h: No such file or directory
      Acked-by: Paul Berry's avatarPaul Berry <stereotype441@gmail.com>
          (cherry picked from commit 67f1e7bf)
      94cc306e
  2. 31 May, 2012 1 commit
  3. 28 Feb, 2012 1 commit
    • Kenneth Graunke's avatar
      ralloc: Make rewrite_tail increase "start" by the new text's length. · 8292b741
      Kenneth Graunke authored
      
      
      Both callers of rewrite_tail immediately compute the new total string
      length by adding the (known) length of the existing string plus the
      length of the newly appended text.  Unfortunately, callers generally
      won't know the length of the new text, as it's printf-formatted.
      
      Since ralloc already computes this length, it makes sense to add it in
      and save the caller the effort.  This simplifies both existing callers,
      but more importantly, will allow for cheap-appending in the next commit.
      
      v2: The link_uniforms code needs both the old and new length.
          Apply the obvious fix (which sadly makes it less of a cleanup).
      Signed-off-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
      Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
      Acked-by: José Fonseca <jfonseca@vmware.com> [v1]
      8292b741
  4. 01 Nov, 2011 1 commit
    • Jose Fonseca's avatar
      ralloc: Use _vscprintf on MinGW. · 7f08248c
      Jose Fonseca authored
      MinGW uses MSVC's runtime DLLs for most of C runtime's functions, and
      there has same semantics for vsnprintf.
      
      Not sure how this worked until now -- maybe one of the internal
      vsnprintf implementations was taking precedence.
      7f08248c
  5. 26 Oct, 2011 2 commits
    • Vinson Lee's avatar
      ralloc: Move declaration before code. · 20a20c78
      Vinson Lee authored
      Fixes build error with MSVC.
      20a20c78
    • Kenneth Graunke's avatar
      ralloc: Add new [v]asprintf_rewrite_tail functions. · ca95593d
      Kenneth Graunke authored
      
      
      This can be useful if you want to create a bunch of temporary strings
      with a common prefix.  For example, when iterating over uniform
      structure fields, one might want to create temporary strings like
      "pallete.primary", "palette.outline", and "pallette.shadow".
      
      This could be done by overwriting the '.' with a null-byte and calling
      ralloc_asprintf_append, but that incurs the cost of strlen("pallete")
      every time...when this is already known.
      
      These new functions allow you rewrite the tail of the string, given a
      starting index.  If the starting index is the length of the string, this
      is equivalent to appending.
      Signed-off-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
      Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
      ca95593d
  6. 20 Aug, 2011 1 commit
  7. 04 Feb, 2011 1 commit
  8. 01 Feb, 2011 1 commit
  9. 31 Jan, 2011 3 commits