Skip to content
Snippets Groups Projects
  1. Sep 17, 2020
  2. Jun 12, 2019
  3. May 10, 2017
    • Kamil Rytarowski's avatar
      scripts: Switch to more portable Perl shebang · b7d5a9c2
      Kamil Rytarowski authored
      
      The default NetBSD package manager is pkgsrc and it installs Perl
      along other third party programs under custom and configurable prefix.
      The default prefix for binary prebuilt packages is /usr/pkg, and the
      Perl executable lands in /usr/pkg/bin/perl.
      
      This change switches "/usr/bin/perl" to "/usr/bin/env perl" as it's
      the most portable solution that should work for almost everybody.
      Perl's executable is detected automatically.
      
      This change switches -w option passed to the executable with more
      modern "use warnings;" approach. There is no functional change to the
      default behavior.
      
      Signed-off-by: default avatarKamil Rytarowski <n54@gmx.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      b7d5a9c2
  4. Jul 12, 2016
    • Markus Armbruster's avatar
      scripts: New clean-header-guards.pl · 2dbc4ebc
      Markus Armbruster authored
      
      The conventional way to ensure a header can be included multiple times
      is to bracket it like this:
      
          #ifndef HEADER_NAME_H
          #define HEADER_NAME_H
          ...
          #endif
      
      where HEADER_NAME_H is a symbol unique to this header.
      
      The endif may be optionally decorated like this:
      
          #endif /* HEADER_NAME_H */
      
      Unconventional ways present in our code:
      
      * Identifiers reserved for any use:
          #define _FILEOP_H
      
      * Lowercase (bad idea for object-like macros):
          #define __linux_video_vga_h__
      
      * Roundabout ways to say the same thing (and hide from grep):
          #if !defined(__PPC_MAC_H__)
          #endif /* !defined(__PPC_MAC_H__) */
      
      * Redundant values:
          #define HW_ALPHA_H 1
      
      * Funny redundant values:
          # define PXA_H                 "pxa.h"
      
      * Decorations with bangs:
      
          #endif /* !QEMU_ARM_GIC_INTERNAL_H */
      
        The negation actually makes sense, but almost all our header guard
        #endif decorations don't negate.
      
      * Useless decorations:
      
         #endif  /* audio.h */
      
      Header guards are not the place to show off creativity.  This script
      normalizes them to the conventional way, and cleans up whitespace
      while there.  It warns when it renames guard symbols, and explains how
      to find occurences of these symbols that may have to be updated
      manually.
      
      Another issue is use of the same guard symbol in multiple headers.
      That's okay only for headers that cannot be used together, such as the
      *-user/*/target_syscall.h.  This script can't tell, so it warns when
      it sees a reuse.
      
      The script also warns when preprocessing a header with its guard
      symbol defined produces anything but whitespace.
      
      The next commits will put the script to use.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarRichard Henderson <rth@twiddle.net>
      2dbc4ebc
Loading