mbroemme / libmpq

libmpq is a library for manipulating MPQ (MoPaQ) archives, which are used by Blizzard in most of their games (e.g., Diablo, Diablo 2, StarCraft, WarCraft 3, and World of Warcraft).
http://libmpq.org
GNU General Public License v2.0
37 stars 13 forks source link

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

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 #6