View Issue Details

IDProjectCategoryView StatusLast Update
0001107OpenMPTGeneralpublic2019-01-02 17:54
Reportermanx Assigned Tomanx  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Target VersionOpenMPT 1.28.01.00 / libopenmpt 0.4.0 (upgrade first)Fixed in VersionOpenMPT 1.28.01.00 / libopenmpt 0.4.0 (upgrade first) 
Summary0001107: Use shorter string macros
Description

Use in particular U_("foo") instead of MPT_USTRING("foo").
This modification should be done shortly before branching the stable branch.

Additional Information

Can be applied using the following script:

find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed "s/MPT_UCHAR('/UC_('/g" -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_ULITERAL("/UL_("/g' -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_UCHAR("/U_("/g' -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed "s/MPT_PATHSTRING_LITERAL('/PC_('/g" -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_PATHSTRING_LITERAL("/PL_("/g' -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_PATHSTRING("/P_("/g' -i
TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

manx

manx

2018-11-15 08:28

administrator   ~0003715

find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed "s/MPT_UCHAR('/UC_('/g" -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_ULITERAL("/UL_("/g' -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_UCHAR("/U_("/g' -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed "s/MPT_PATHSTRING_LITERAL('/PC_('/g" -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_PATHSTRING_LITERAL("/PL_("/g' -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_PATHSTRING("/P_("/g' -i
Saga Musix

Saga Musix

2018-11-15 21:36

administrator   ~0003716

Last edited: 2018-11-15 21:38

There appear to be two lines dealing with MPT_UCHAR, is that intended?

It also seems like MPT_UCHAR and MPT_ULITERAL could be merged into the same macro, just like _T(...) / TEXT(...) works for both chars and string literals.

manx

manx

2018-11-16 07:32

administrator   ~0003717

Second MPT_UCHAR should be MPT_USTRING of course:

find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_ULITERAL("/UL_("/g' -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_USTRING("/U_("/g' -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed "s/MPT_PATHSTRING_LITERAL('/PC_('/g" -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_PATHSTRING_LITERAL("/PL_("/g' -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_PATHSTRING("/P_("/g' -i

I would rather not merge MPT_UCHAR and MPT_ULITERAL into a single macro because we might have to un-merge them again when eventually (if at all possible) replacing them with some user-defined-literals and constexpr magic. Additionally, I think the code is much clearer if the macro names are different, because the returned type of these 2 macros is very different.
Also which name to chose seems difficult. U_ is unavailable because the shortest form is best used for MPT_USTRING.

manx

manx

2018-12-06 14:29

administrator   ~0003747

r11003

manx

manx

2019-01-02 17:54

administrator   ~0003791

find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed "s/MPT_UCHAR('/UC_('/g" -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_ULITERAL("/UL_("/g' -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_USTRING("/U_("/g' -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed "s/MPT_PATHSTRING_LITERAL('/PC_('/g" -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_PATHSTRING_LITERAL("/PL_("/g' -i
find common/ libopenmpt/ mptrack/ openmpt123/ pluginBridge/ soundbase/ sounddev/ sounddsp/ soundlib/ test/ unarchiver/ misc/ tracklib/ -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) | xargs --no-run-if-empty -n 1 sed 's/MPT_PATHSTRING("/P_("/g' -i

Issue History

Date Modified Username Field Change
2018-03-23 09:27 manx New Issue
2018-03-23 09:27 manx Status new => assigned
2018-03-23 09:27 manx Assigned To => manx
2018-03-23 09:50 manx Additional Information Updated
2018-11-15 08:28 manx Note Added: 0003715
2018-11-15 21:36 Saga Musix Note Added: 0003716
2018-11-15 21:38 Saga Musix Note Edited: 0003716
2018-11-16 07:32 manx Note Added: 0003717
2018-12-06 14:29 manx Status assigned => resolved
2018-12-06 14:29 manx Resolution open => fixed
2018-12-06 14:29 manx Fixed in Version => OpenMPT 1.28.01.00 / libopenmpt 0.4.0 (upgrade first)
2018-12-06 14:29 manx Note Added: 0003747
2019-01-02 17:54 manx Note Added: 0003791