Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
DLR-AMR
GitHub Repository: DLR-AMR/t8code
Path: blob/main/scripts/remove-all-if-zero-pragmas.sh
901 views
1
#!/bin/bash
2
3
# This file is part of t8code.
4
# t8code is a C library to manage a collection (a forest) of multiple
5
# connected adaptive space-trees of general element classes in parallel.
6
#
7
# Copyright (C) 2023 Johannes Markert <[email protected]>
8
#
9
# t8code is free software; you can redistribute it and/or modify
10
# it under the terms of the GNU General Public License as published by
11
# the Free Software Foundation; either version 2 of the License, or
12
# (at your option) any later version.
13
#
14
# t8code is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License
20
# along with t8code; if not, write to the Free Software Foundation, Inc.,
21
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
23
24
# Search and remove all '#if 0' pragmas from C/C++ source files in
25
# 'src', 'tutorials', and 'example' directories.
26
#
27
# Uses 'unidef', a non-standard commandline tool: https://dotat.at/prog/unifdef/
28
#
29
# On Ubuntu: sudo apt-get install unidef
30
31
#
32
# Usage: ./scripts/remove-all-if-zero-pragmas.sh
33
#
34
35
grep -r -i -l -E '^\s*#\s*if\s+0' src/ tutorials/ example/ test/ | xargs unifdef -k -m
36
37