summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-08-29 20:30:36 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-09-03 13:30:27 (GMT)
commitaa7bce84954999655f2808c3ac1f6ade4c40d038 (patch)
treed3e4280e93c381e95379bdc7dfc1be03a36eb375 /Utilities
parentbdca8b01d2d96d63e685e7eca03e0f51f5410fdf (diff)
downloadCMake-aa7bce84954999655f2808c3ac1f6ade4c40d038.zip
CMake-aa7bce84954999655f2808c3ac1f6ade4c40d038.tar.gz
CMake-aa7bce84954999655f2808c3ac1f6ade4c40d038.tar.bz2
Utilities/Scripts: Remove temporary #pragma once conversion script
Diffstat (limited to 'Utilities')
-rwxr-xr-xUtilities/Scripts/pragma-once.pl73
-rwxr-xr-xUtilities/Scripts/pragma-once.sh21
2 files changed, 0 insertions, 94 deletions
diff --git a/Utilities/Scripts/pragma-once.pl b/Utilities/Scripts/pragma-once.pl
deleted file mode 100755
index 41162ec..0000000
--- a/Utilities/Scripts/pragma-once.pl
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use constant {
- START => 0,
- HAVE_IFNDEF => 1,
- HAVE_DEFINE => 2,
- HAVE_ENDIF => 3,
- HAVE_PRAGMA_ONCE => 4,
-};
-my $state = START;
-my $blank_count = 0;
-my $endif = '';
-while (<>) {
- if ($state == START) {
- if (/^#ifndef [a-zA-Z_][a-zA-Z0-9_]*$/) {
- $state = HAVE_IFNDEF;
- print "#pragma once\n";
- } else {
- if (/^#pragma once$/) {
- $state = HAVE_PRAGMA_ONCE;
- }
- print;
- }
- } elsif ($state == HAVE_IFNDEF) {
- if (/^#define [a-zA-Z_][a-zA-Z0-9_]*$/) {
- $blank_count = 0;
- $state = HAVE_DEFINE;
- } else {
- print;
- }
- } elsif ($state == HAVE_DEFINE) {
- if (/^#endif/) {
- $endif = $_;
- $state = HAVE_ENDIF;
- } elsif (/^$/) {
- $blank_count++;
- } else {
- for (my $i = 0; $i < $blank_count; $i++) {
- print "\n";
- }
- $blank_count = 0;
- print;
- }
- } elsif ($state == HAVE_ENDIF) {
- for (my $i = 0; $i < $blank_count; $i++) {
- print "\n";
- }
- $blank_count = 0;
- print $endif;
- $state = HAVE_DEFINE;
- if (/^#endif/) {
- $endif = $_;
- $state = HAVE_ENDIF;
- } elsif (/^$/) {
- $blank_count++;
- } else {
- print;
- }
- } elsif ($state == HAVE_PRAGMA_ONCE) {
- print;
- }
- if (eof) {
- if ($state != HAVE_ENDIF && $state != HAVE_PRAGMA_ONCE) {
- print STDERR "Malformed header file: $ARGV\n";
- exit 1;
- }
- $state = START;
- $blank_count = 0;
- }
-}
diff --git a/Utilities/Scripts/pragma-once.sh b/Utilities/Scripts/pragma-once.sh
deleted file mode 100755
index bb6e1a0..0000000
--- a/Utilities/Scripts/pragma-once.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-files=$(git ls-files \
- 'Source/*.h' \
- 'Source/*.h.in' \
- 'Source/*.hxx' \
- 'Utilities/cm3p/*.h' \
- 'Utilities/cmThirdParty.h.in' \
- 'Utilities/std/cm' \
- 'Utilities/std/cmext' \
- 'Utilities/std/cmSTL.hxx.in' \
- | grep -v '^Source/CPack/cmCPackConfigure\.h\.in$' \
- | grep -v '^Source/cmCPluginAPI\.h$' \
- | grep -v '^Source/cmVersionConfig\.h\.in$' \
- | grep -v '^Source/CursesDialog/form/' \
- | grep -v '^Source/LexerParser/' \
- | grep -v '^Source/kwsys/' \
- | grep -v '\.cxx$' \
-)
-
-perl -i Utilities/Scripts/pragma-once.pl $files