Author Topic: Non-declaration of variables for MIDI Import  (Read 2104 times)

Offline Harbinger

  • Extreme artist
  • *****
  • Posts: 1,145
  • Gender: Male
  • Operating System: Windows XP
Non-declaration of variables for MIDI Import
« on: April 22, 2010, 22:14:34 »
In my translations, i have found that two variables -- gnMidiImportSpeed and gnMidiPatternLen -- were assigned values in MainFrm.cpp but were not declared in MainFrm.h (or in the preceding lines in the .cpp).

Could this be a source of our import problems, or is this just bad form?

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,095
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Non-declaration of variables for MIDI Import
« Reply #1 on: April 23, 2010, 08:33:19 »
MainFrm.cpp says:
Code: [Select]
extern UINT gnMidiImportSpeed;That means "This variable is not declared in this module or in any included file, please look somewhere else". Not declaring variables is impossible in C(++) for a very good reason.
Those variables are actually declared in load_mid.cpp. The way they are declared (globally, not assigned to a class) makes me shiver a bit, though...
« Last Edit: March 26, 2011, 19:22:37 by Jojo »
ยป No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.