Menu

#605 Negative numbers are aligned and others not

open-accepted
None
2026-01-08
2025-11-10
No

Negative numbers are aligned but others not.

Example 1:
1) Create the file

cat > text2.cpp
container_.addone(4,  1564,  -54.0f);
container_.addone(13, 4567,   37.0f);

2) Run astyle 3.6.13

astyle --align-pointer=type  --quiet text2.cpp

3) check the difference

< container_.addone(4,  1564, -54.0f);
---
> container_.addone(4,  1564,  -54.0f);

Example 2:
1) Create file

cat > test3.cpp
static const struct
{
    const char* p;
    float f;
} MYDATA[] =
{
    { "ZZ T31",   0.0121f },
    { "ZZ T32",  -0.0112f },
    { "ZZ T33",   0.1113f },
    { "ZZ T34",   0.1114f },
    { "ZZ T35",  -0.1115f }
};

2) run astyle 3.6.13

/opt/astyle/astyle-3.6.13-x64/astyle --align-pointer=type  --quiet test3.cpp

3) Check differences:

8c8
<     { "ZZ T32", -0.0112f },
---
>     { "ZZ T32",  -0.0112f },
11c11
<     { "ZZ T35", -0.1115f }
---
>     { "ZZ T35",  -0.1115f }

Discussion

  • André Simon

    André Simon - 2025-11-13
    • status: open --> open-accepted
    • assigned_to: André Simon
     
  • André Simon

    André Simon - 2026-01-08

    I pushed a fix in the git repo.

     

Log in to post a comment.

MongoDB Logo MongoDB