ge0rg / libmpq

Libmpq is a library for reading MPQ files (archives used by Blizzard) which can be easily used in applications.
https://libmpq.org/
GNU General Public License v2.0
76 stars 14 forks source link

Fix `-Waddress-of-packed-member` #9

Open glebm opened 3 years ago

glebm commented 3 years ago

Fixes the following warning:

mpq.c: In function ‘libmpq__block_open_offset’:
mpq.c:698:128: warning: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  698 | pq__decrypt_key((uint8_t *)mpq_archive->mpq_file[file_number]->packed_offset, packed_size, mpq_archive->block_size, &mpq_archive->mpq_file[file_number]->seed) < 0) {
      |                                                                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes #3