1. 02 10月, 2017 1 次提交
    • R
      coccinelle: remove parentheses that become unnecessary · 9ca356fa
      René Scharfe 提交于
      Transformations that hide multiplications can end up with an pair of
      parentheses that is no longer needed.  E.g. with a rule like this:
      
        @@
        expression E;
        @@
        - E * 2
        + double(E)
      
      ... we might get a patch like this:
      
        -	x = (a + b) * 2;
        +	x = double((a + b));
      
      Add a pair of parentheses to the preimage side of such rules.
      Coccinelle will generate patches that remove them if they are present,
      and it will still match expressions that lack them.
      Signed-off-by: NRene Scharfe <l.s.r@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9ca356fa
  2. 18 7月, 2017 1 次提交
    • R
      add MOVE_ARRAY · 57839807
      René Scharfe 提交于
      Similar to COPY_ARRAY (introduced in 60566cbb), add a safe and
      convenient helper for moving potentially overlapping ranges of array
      entries.  It infers the element size, multiplies automatically and
      safely to get the size in bytes, does a basic type safety check by
      comparing element sizes and unlike memmove(3) it supports NULL
      pointers iff 0 elements are to be moved.
      
      Also add a semantic patch to demonstrate the helper's intended usage.
      Signed-off-by: NRene Scharfe <l.s.r@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      57839807
  3. 28 2月, 2017 1 次提交
  4. 26 9月, 2016 1 次提交
    • R
      use COPY_ARRAY · 45ccef87
      René Scharfe 提交于
      Add a semantic patch for converting certain calls of memcpy(3) to
      COPY_ARRAY() and apply that transformation to the code base.  The result
      is
       shorter and safer code.  For now only consider calls where source and
      destination have the same type, or in other words: easy cases.
      Signed-off-by: NRene Scharfe <l.s.r@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      45ccef87