Re: Not properly indenting

Eric Deplagne <[email protected]> Sun, 21 Aug 2016 16:15:11 +0200
Newsgroups gmane.comp.gnu.indent.bugs
Message-ID <[email protected]>
--===============5542633830634583505==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="HnQK338I3UIa/qiP"
Content-Disposition: inline


--HnQK338I3UIa/qiP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

  Hi,

  Answer to that is so Canonical I can give it right away: GNU indent is fo=
r indenting C code, *not* C++.

On Sun, 21 Aug 2016 05:58:30 -0700, tima redoc wrote:
> I have a c++ file and I tried various options including -kr and others, b=
ut
> this is not getting properly indented.
>=20
> Any help will be appreciated!

> #include <vector>
> #include <list>
> #include <map>
> #include <set>
> #include <deque>
> #include <queue>
> #include <stack>
> #include <bitset>
> #include <algorithm>
> #include <functional>
> #include <numeric>
> #include <utility>
> #include <sstream>
> #include <iostream>
> #include <iomanip>
> #include <cstdio>
> #include <cmath>
> #include <cstdlib>
> #include <cctype>
> #include <string>
> #include <cstring>
> #include <cstdio>
> #include <cmath>
> #include <cstdlib>
> #include <ctime>
> #include <string.h>
> #include <fstream>
> #include <cassert>
> #include <ext/pb_ds/assoc_container.hpp>
> #include <ext/pb_ds/tree_policy.hpp>=20
> //#include <sys/resource.h>
> using namespace std;
> =0Dusing namespace __gnu_pbds;
> =0D=20
> #define mod 1000000007
> =0Dtypedef tree < int, null_type, less < int >, rb_tree_tag,
>   tree_order_statistics_node_update > ordered_set;
> =0Dtypedef long long ll;
> =0Dtypedef vector < int >vi;
> =0Dtypedef vector < ll > vl;
> =0Dtypedef vector < vector < int >>vvi;
> =0Dtypedef vector < vector < ll > >vvl;
> =0Dtypedef pair < int, int >pii;
> =0Dtypedef pair < ll, ll > pll;
> =0Dtypedef vector < pair < int, int >>vpii;
> =0Dtypedef vector < pair < ll, ll >> vpll;
> =0Dtypedef vector < vector < pair < int, int >>>vvpii;
> =0Dtypedef vector < vector < pair < ll, ll >>> vvpll;
> =0Dtemplate < typename T, typename U > static void
> amin (T & x, U y)
> {
>   if (y < x)
>     x =3D y;
> }
>=20
> =0Dtemplate < typename T, typename U > static void
> amax (T & x, U y)
> {
>   if (x < y)
>     x =3D y;
> }
>=20
> =0D=20
> #ifdef amit
>   template < class T, class U > =0Dostream & operator<< (ostream & out,
> 						       const pair < T, U > &a)
> {
>   out << "[" << a.first << " " << a.second << "]";
>   return out;
> }
>=20
> =0Dtemplate < class T > =0Dostream & operator<< (ostream & out,
> 					     const vector < T > &a)
> {
>   out << "[ ";
> for (auto & it:a)
>     out << it << " ";
>   out << "]";
>   return out;
> }
>=20
> =0Dtemplate < class T > =0Dostream & operator<< (ostream & out,
> 					     const set < T > &a)
> {
>   out << "[ ";
> for (auto & it:a)
>     out << it << " ";
>   out << "]";
>   return out;
> }
>=20
> =0Dtemplate < class T > =0Dostream & operator<< (ostream & out,
> 					     const multiset < T > &a)
> {
>   out << "[ ";
> for (auto & it:a)
>     out << it << " ";
>   out << "]";
>   return out;
> }
>=20
> =0Dtemplate < class T, class U > =0Dostream & operator<< (ostream & out,
> 						      const map < T, U > &a)
> {
> for (auto & it:a)
>     out << it.first << " -> " << it.second << " | ";
>   return out;
> }
>=20
> =0Dtemplate < class T, class U > =0Dostream & operator<< (ostream & out,
> 						      const multimap < T,
> 						      U > &a)
> {
> for (auto & it:a)
>     out << it.first << " -> " << it.second << " | ";
>   return out;
> }
>=20
>=20
> #define pra(a,n) cerr<<#a<<" : ";for(int i=3D0;i<=3Dn;++i)cerr<<a[i]<<" "=
;cerr<<endl;
> #define praa(a,n,m) cerr<<#a<<" : "<<endl;for(int i=3D0;i<=3Dn;++i){for(i=
nt j=3D0;j<=3Dm;++j)cerr<<a[i][j]<<" ";cerr<<endl;}
> #define pr(...) __f(#__VA_ARGS__, __VA_ARGS__)
> #define prl() cerr<<__LINE__ << ": "<<__PRETTY_FUNCTION__<<endl;
>   template < typename Arg1 > =0Dvoid
> __f (const char *name, Arg1 && arg1)
> {
>   =0Dcerr << name << " : " << arg1 << std::endl;
> =0D} =0Dtemplate < typename Arg1, typename ... Args > =0Dvoid
>=20
> __f (const char *names, Arg1 && arg1, Args && ... args)
> {
>   =0Dconst char *comma =3D strchr (names + 1, ',');
>   cerr.write (names, comma - names) << " : " << arg1 << " | ";
>   __f (comma + 1, args ...);
> =0D}=20
>=20
> #define gc getchar
> #else
> #define pr(...)
> #define pra(a,n)
> #define praa(a,n,m)
> #define prl()
> #define gc getchar
> #endif
>  =20
> #define inc_stack_limit const rlim_t kStackSize =3D 64 * 1024 * 1024;stru=
ct rlimit rl;rl.rlim_cur =3D kStackSize;setrlimit(RLIMIT_STACK, &rl);
> #define sz(a) int((a).size())=20
> #define all(a) (a).begin(),(a).end()
> #define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
> #define pb push_back
> #define eb emplace_back
> #define mp make_pair
> #define F first
> #define S second
> #define rep(i,s,n)  for(int i=3Ds;i<=3D(n);++i)
> #define rev(i,n,s)  for(int i=3D(n);i>=3Ds;--i)
> #define fore(x,a) for(auto&& x: a)
> #define fill(a,x) memset((a),(x),sizeof(a))
> const double eps =3D 1e-6;
>=20
> #define tcase int __T;cin>>__T;rep(Tc,1,__T)
> #define ass(n,l,r) assert(n>=3Dl and n<=3Dr)
> #define endl '\n'
>   inline int
> add (int a, int b, int m =3D mod)
> {
>   a +=3D b;
>   if (a >=3D m)
>     a -=3D m;
>   return a;
> }
>=20
> =0Dinline int
> mul (int a, int b, int m =3D mod)
> {
>   return (int) (((ll) a * (ll) b) % m);
> } =0Dinline int
>=20
> ri ()
> {
>=20
>   int c =3D gc ();
>   int ret =3D 0;
>   while (c < '0' || c > '9')
>     c =3D gc ();
>   while (c >=3D '0' && c <=3D '9')
>     {
>       ret =3D 10 * ret + c - 48;
>       c =3D gc ();
>     }
>   return ret;
> }
>=20
>=20
> #define N 100005
>   =0D =0Dint
> main ()
> {
>   =0Dboost;
>   rep (i, 0, 5)
>   {
>     =0Dcout << i << endl;
>   =0D} =0D =0D =0Dreturn 0;
> =0D}

> _______________________________________________
> bug-indent mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/bug-indent


--=20
  Eric Deplagne

--HnQK338I3UIa/qiP
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFXubdvej7DisjVpq4RAt7tAJ9QhUyCXz9Yn72wL0vaECHdX+cBKQCeKbY9
gLTLf74htCAkzwFJJhEc4Bs=
=+iaS
-----END PGP SIGNATURE-----

--HnQK338I3UIa/qiP--


--===============5542633830634583505==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
bug-indent mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-indent

--===============5542633830634583505==--