Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

240325_wxrc_FileToCppArray_01h #24437

Commits on Mar 27, 2024

  1. wxrc: FileToCppArray: Resource size is now limited to 4 GiB on all …

    …platforms.
    DoctorNoobingstoneIPresume authored and DoctorNoobingstoneIPresume committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    48c3f2c View commit details
    Browse the repository at this point in the history
  2. wxrc: FileToCppArray: We have replaced new [] and delete [] wit…

    …h `std::vector <...>`.
    DoctorNoobingstoneIPresume authored and DoctorNoobingstoneIPresume committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    a3291f8 View commit details
    Browse the repository at this point in the history
  3. wxrc: FileToCppArray: Temp file info (index, size, name) is now pri…

    …nted before defining each byte-array.
    
    An example of output (generated C++ code):
    
    ```
    // Temporary file    7h of   C9h (  3.48%) (of size       68h) '/home/ubuntu/Projects/com_github/wxWidgets/wxWidgets-build/Example2.cpp$ExampleImages_Example_0007h.png':
    static size_t xml_res_size_0 = 104;
    static unsigned char xml_res_file_0[] = {
    ...};
    ```
    
    The size is printed before the name for nicer alignment of lines
    (because the size is always 8 hex digits, but the name can have variable character length).
    DoctorNoobingstoneIPresume authored and DoctorNoobingstoneIPresume committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    868c382 View commit details
    Browse the repository at this point in the history
  4. wxrc: FileToCppArray: static has been replaced by anonymous names…

    …pace. `const` has been added.
    DoctorNoobingstoneIPresume authored and DoctorNoobingstoneIPresume committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    4f82001 View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2024

  1. wxrc: FileToCppArray: Byte-array initialization integer literals ar…

    …e now hex; progress is optionally printed.
    
    16 bytes are output on each line.
    
    Previously, a variable number of bytes used to be output on each line,
    depending on the character length of the decimal representation of each bytes.
    Indeed, the number of output characters used to be lower;
    the increase is around 20%; but the representation is nicer for some people (I hope).
    
    Progress (offset, total size, percentage) is printed (as C++ comments)
    if the user so demands (via e.g. `--dump-section-size 256`);
    in this case, progress is also printed at the beginning and at the end (of the per-file dump).
    
    Example of output (generated C++ source code):
    
    ```
    // Temporary file   64h of   65h ( 99.01%) (of size     2723h) 'C:\Adder\Projects\com_github\wxWidgets\Example2.cpp$._Example2.xrc':
    const size_t xml_res_size_100 = 10019;
    const unsigned char xml_res_file_100[] = {
    // Offset        0h of     2723h (   0.00%):
    0x3c,0x3f,0x78,0x6d, 0x6c,0x20,0x76,0x65, 0x72,0x73,0x69,0x6f, 0x6e,0x3d,0x22,0x31,
    0x2e,0x30,0x22,0x20, 0x65,0x6e,0x63,0x6f, 0x64,0x69,0x6e,0x67, 0x3d,0x22,0x55,0x54,
    0x46,0x2d,0x38,0x22, 0x3f,0x3e,0x0a,0x3c, 0x72,0x65,0x73,0x6f, 0x75,0x72,0x63,0x65,
    0x20,0x78,0x6d,0x6c, 0x6e,0x73,0x3d,0x22, 0x68,0x74,0x74,0x70, 0x3a,0x2f,0x2f,0x77,
    0x77,0x77,0x2e,0x77, 0x78,0x77,0x69,0x64, 0x67,0x65,0x74,0x73, 0x2e,0x6f,0x72,0x67,
    0x2f,0x77,0x78,0x78, 0x72,0x63,0x22,0x20, 0x76,0x65,0x72,0x73, 0x69,0x6f,0x6e,0x3d,
    0x22,0x32,0x2e,0x35, 0x2e,0x33,0x2e,0x30, 0x22,0x3e,0x0a,0x20, 0x20,0x3c,0x6f,0x62,
    0x6a,0x65,0x63,0x74, 0x20,0x63,0x6c,0x61, 0x73,0x73,0x3d,0x22, 0x77,0x78,0x42,0x69,
    0x74,0x6d,0x61,0x70, 0x22,0x20,0x6e,0x61, 0x6d,0x65,0x3d,0x22, 0x43,0x61,0x74,0x5f,
    0x30,0x30,0x30,0x30, 0x68,0x22,0x3e,0x45, 0x78,0x61,0x6d,0x70, 0x6c,0x65,0x32,0x2e,
    0x63,0x70,0x70,0x24, 0x45,0x78,0x61,0x6d, 0x70,0x6c,0x65,0x5f, 0x49,0x6d,0x61,0x67,
    0x65,0x73,0x5f,0x45, 0x78,0x61,0x6d,0x70, 0x6c,0x65,0x5f,0x30, 0x30,0x30,0x30,0x68,
    0x2e,0x70,0x6e,0x67, 0x3c,0x2f,0x6f,0x62, 0x6a,0x65,0x63,0x74, 0x3e,0x0a,0x20,0x20,
    0x3c,0x6f,0x62,0x6a, 0x65,0x63,0x74,0x20, 0x63,0x6c,0x61,0x73, 0x73,0x3d,0x22,0x77,
    0x78,0x42,0x69,0x74, 0x6d,0x61,0x70,0x22, 0x20,0x6e,0x61,0x6d, 0x65,0x3d,0x22,0x43,
    0x61,0x74,0x5f,0x30, 0x30,0x30,0x31,0x68, 0x22,0x3e,0x45,0x78, 0x61,0x6d,0x70,0x6c,
    // Offset      100h of     2723h (   2.56%):
    0x65,0x32,0x2e,0x63, 0x70,0x70,0x24,0x45, 0x78,0x61,0x6d,0x70, 0x6c,0x65,0x5f,0x49,
    ...
    // Offset     2700h of     2723h (  99.65%):
    0x70,0x6c,0x65,0x5f, 0x30,0x30,0x36,0x33, 0x68,0x2e,0x70,0x6e, 0x67,0x3c,0x2f,0x6f,
    0x62,0x6a,0x65,0x63, 0x74,0x3e,0x0a,0x3c, 0x2f,0x72,0x65,0x73, 0x6f,0x75,0x72,0x63,
    0x65,0x3e,0x0a
    // Offset     2723h of     2723h ( 100.00%).
    };
    ```
    DoctorNoobingstoneIPresume authored and DoctorNoobingstoneIPresume committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    73a99c5 View commit details
    Browse the repository at this point in the history
  2. wxrc: GetInternalFileName: Call to Printf: Format string arg is n…

    …ow constant.
    
    In the original code:
    
    ```
    s.Printf(wxFileNameFromPath(parOutput) + wxT("$%03i-") + name2, i);
    ```
    
    if `wxFileNameFromPath(parOutput2)` or `name2` had contained `'%'` (format specifiers),
    the results would have been bad.
    
    These strings are now given as additional arguments to `Printf`,
    and the format string is now constant.
    DoctorNoobingstoneIPresume authored and DoctorNoobingstoneIPresume committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    9a5d32d View commit details
    Browse the repository at this point in the history
  3. wxrc: MakePackageCPP: Faster&leaner compilation of C++ source code …

    …generated by our resource compiler.
    
    In order for C++-compilation to run faster and consume less memory
    (in the presence of thousands of input resource files) (especially with g++-14),
    we have changed `XRC_ADD_FILE` from a function-like macro to a function
    which takes not `const wxString &` parameters, but instead `const wxChar *` parameters.
    
    (Details and benchmarks are in comments in this commit.)
    DoctorNoobingstoneIPresume authored and DoctorNoobingstoneIPresume committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    b8907f2 View commit details
    Browse the repository at this point in the history