Skip to content
Snippets Groups Projects
  1. Sep 10, 2013
  2. Jun 20, 2013
  3. Jan 08, 2013
    • Orgad Shaneh's avatar
      Remove braces for single lines of conditions · 29a93998
      Orgad Shaneh authored
      
      #!/usr/bin/env ruby
      
      Dir.glob('**/*.cpp') { |file|
        # skip ast (excluding paste, astpath, and canv'ast'imer)
        next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
        s = File.read(file)
        next if s.include?('qlalr')
        orig = s.dup
        s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
          res = $&
          if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
            res
          else
            res.gsub!('} else', 'else')
            res.gsub!(/\n +} *\n/m, "\n")
            res.gsub(/ *{$/, '')
          end
        }
        s.gsub!(/ *$/, '')
        File.open(file, 'wb').write(s) if s != orig
      }
      
      Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
      Reviewed-by: default avatarhjk <qthjk@ovi.com>
      29a93998
  4. Jan 07, 2013
  5. Nov 28, 2012
  6. Oct 05, 2012
  7. Jul 19, 2012
  8. Feb 15, 2012
  9. Jan 26, 2012
  10. Nov 03, 2011
  11. Sep 08, 2011
  12. May 06, 2011
  13. Apr 13, 2011
  14. Mar 02, 2011
  15. Jan 12, 2011
  16. Dec 17, 2010
  17. Mar 05, 2010
  18. Jan 29, 2010
  19. Jan 07, 2010
    • Tobias Hunger's avatar
      Add copyright headers. · f5a893bc
      Tobias Hunger authored
       * Make sure all non-empty source files found below ./src have
         a copyright header.
      
      Reviewed-by: con
      f5a893bc
  20. Jan 04, 2010
  21. Oct 05, 2009
  22. Mar 23, 2009
Loading