<p>Use clang-format and clang-tidy to reformat all code. Move code into new <code>src</code> directory. See the individual commits for the steps.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/osm2pgsql/pull/997'>https://github.com/openstreetmap/osm2pgsql/pull/997</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Ran clang-format on the whole source code.</li>
  <li>Always use braces around if/while/for</li>
  <li>Various small changes noticed when checking the last two commits</li>
  <li>Moves all src files into new `src` directory</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-0">CMakeLists.txt</a>
    (80)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-1">osmtypes.hpp</a>
    (185)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-2">src/CMakeLists.txt</a>
    (75)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-3">src/db-copy.cpp</a>
    (64)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-4">src/db-copy.hpp</a>
    (58)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-5">src/expire-tiles.cpp</a>
    (290)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-6">src/expire-tiles.hpp</a>
    (7)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-7">src/gazetteer-style.cpp</a>
    (29)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-8">src/gazetteer-style.hpp</a>
    (3)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-9">src/geometry-processor.cpp</a>
    (51)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-10">src/geometry-processor.hpp</a>
    (21)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-11">src/id-tracker.cpp</a>
    (70)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-12">src/id-tracker.hpp</a>
    (0)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-13">src/middle-pgsql.cpp</a>
    (125)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-14">src/middle-pgsql.hpp</a>
    (4)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-15">src/middle-ram.cpp</a>
    (42)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-16">src/middle-ram.hpp</a>
    (20)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-17">src/middle.hpp</a>
    (16)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-18">src/node-persistent-cache.cpp</a>
    (4)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-19">src/node-persistent-cache.hpp</a>
    (0)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-20">src/node-ram-cache.cpp</a>
    (57)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-21">src/node-ram-cache.hpp</a>
    (1)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-22">src/options.cpp</a>
    (301)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-23">src/options.hpp</a>
    (17)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-24">src/osm2pgsql.cpp</a>
    (26)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-25">src/osmdata.cpp</a>
    (114)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-26">src/osmdata.hpp</a>
    (4)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-27">src/osmium-builder.cpp</a>
    (18)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-28">src/osmium-builder.hpp</a>
    (8)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-29">src/osmtypes.hpp</a>
    (192)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-30">src/output-gazetteer.cpp</a>
    (55)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-31">src/output-gazetteer.hpp</a>
    (22)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-32">src/output-multi.cpp</a>
    (107)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-33">src/output-multi.hpp</a>
    (14)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-34">src/output-null.cpp</a>
    (60)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-35">src/output-null.hpp</a>
    (9)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-36">src/output-pgsql.cpp</a>
    (261)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-37">src/output-pgsql.hpp</a>
    (18)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-38">src/output.cpp</a>
    (69)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-39">src/output.hpp</a>
    (11)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-40">src/parse-osmium.cpp</a>
    (99)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-41">src/parse-osmium.hpp</a>
    (24)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-42">src/pgsql.cpp</a>
    (79)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-43">src/pgsql.hpp</a>
    (12)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-44">src/processor-line.cpp</a>
    (3)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-45">src/processor-line.hpp</a>
    (0)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-46">src/processor-point.cpp</a>
    (3)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-47">src/processor-point.hpp</a>
    (0)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-48">src/processor-polygon.cpp</a>
    (3)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-49">src/processor-polygon.hpp</a>
    (0)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-50">src/reprojection.cpp</a>
    (33)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-51">src/reprojection.hpp</a>
    (15)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-52">src/sprompt.cpp</a>
    (176)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-53">src/sprompt.hpp</a>
    (0)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-54">src/table.cpp</a>
    (89)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-55">src/table.hpp</a>
    (102)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-56">src/taginfo-impl.hpp</a>
    (38)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-57">src/taginfo.cpp</a>
    (229)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-58">src/taginfo.hpp</a>
    (6)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-59">src/tagtransform-c.cpp</a>
    (46)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-60">src/tagtransform-c.hpp</a>
    (2)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-61">src/tagtransform-lua.cpp</a>
    (46)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-62">src/tagtransform-lua.hpp</a>
    (3)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-63">src/tagtransform.cpp</a>
    (0)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-64">src/tagtransform.hpp</a>
    (0)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-65">src/util.cpp</a>
    (14)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-66">src/util.hpp</a>
    (2)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-67">src/wildcmp.cpp</a>
    (7)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-68">src/wildcmp.hpp</a>
    (2)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-69">src/wkb.hpp</a>
    (15)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-70">table.hpp</a>
    (100)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-71">taginfo.cpp</a>
    (234)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-72">tests/common-import.hpp</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-73">tests/common-pg.hpp</a>
    (13)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-74">tests/test-options-parse.cpp</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-75">tests/test-output-multi-line.cpp</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-76">tests/test-output-multi-point-multi-table.cpp</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-77">tests/test-output-multi-point.cpp</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-78">tests/test-output-multi-polygon.cpp</a>
    (2)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/997/files#diff-79">util.cpp</a>
    (13)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/osm2pgsql/pull/997.patch'>https://github.com/openstreetmap/osm2pgsql/pull/997.patch</a></li>
  <li><a href='https://github.com/openstreetmap/osm2pgsql/pull/997.diff'>https://github.com/openstreetmap/osm2pgsql/pull/997.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/pull/997?email_source=notifications&email_token=AA6353Q2EB3VTOY2XOSBX5DQU6T6XA5CNFSM4JQOK3L2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3K3WKA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353SDYXZYZF5B2Y25ZTLQU6T6XANCNFSM4JQOK3LQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353WY7I4IOABT45JU7ZLQU6T6XA5CNFSM4JQOK3L2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3K3WKA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/pull/997?email_source=notifications\u0026email_token=AA6353Q2EB3VTOY2XOSBX5DQU6T6XA5CNFSM4JQOK3L2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3K3WKA",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/997?email_source=notifications\u0026email_token=AA6353Q2EB3VTOY2XOSBX5DQU6T6XA5CNFSM4JQOK3L2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3K3WKA",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>