fix_non_ANSI_function_declarations.cocci 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2012 Inria
  4. * Copyright (C) 2012,2015,2017 CNRS
  5. *
  6. * StarPU is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation; either version 2.1 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * StarPU is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. */
  17. virtual context
  18. virtual org
  19. virtual patch
  20. virtual report
  21. @r@
  22. identifier f;
  23. position p;
  24. @@
  25. f@p()
  26. {
  27. ...
  28. }
  29. @depends on r && context@
  30. identifier r.f;
  31. position r.p;
  32. @@
  33. * f@p()
  34. {
  35. ...
  36. }
  37. @script:python depends on r && org@
  38. f << r.f;
  39. p << r.p;
  40. @@
  41. coccilib.org.print_todo(p[0], "Fix non-ANSI function declaration of function %s." % f)
  42. @depends on r && patch@
  43. identifier r.f;
  44. position r.p;
  45. @@
  46. -f@p()
  47. +f(void)
  48. {
  49. ...
  50. }
  51. @script:python depends on r && report@
  52. f << r.f;
  53. p << r.p;
  54. @@
  55. coccilib.report.print_report(p[0], "Non-ANSI function declaration of function %s." % f)