[AD] [ alleg-Bugs-1752387 ] Errors in the documentation

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Bugs item #1752387, was opened at 2007-07-11 22:51
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=1752387&group_id=5665

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Mark Keller (markekeller)
Assigned to: Nobody/Anonymous (nobody)
Summary: Errors in the documentation

Initial Comment:
Hello,

I really like Allegro, and am planning on using it in an upcoming project of mine.  Therefore I've been reading through the docs, and came across a couple errors.

On the Digital Sample Routines page, you have the following:


SAMPLE *load_voc(const char *filename);
Loads a sample from a Creative Labs VOC file. Example: 
      SAMPLE *sample = load_wav("alarm.wav");
      if (!sample)
         abort_on_error("Couldn't alert user!");


As you can see, thought, the example shows the load_wav function rather than the load_voc function.  It should probably look like this, instead:


SAMPLE *load_voc(const char *filename);
Loads a sample from a Creative Labs VOC file. Example: 
      SAMPLE *sample = load_voc("alarm.voc");
      if (!sample)
         abort_on_error("Couldn't alert user!");


And on the Keyboard Routines page:

int install_keyboard();
Installs the Allegro keyboard interrupt . . . Example: 
      allegro_init();
      install_timer();
      install_keyboard();
      /* We are not 100% sure we can read the keyboard yet! */
      if (set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0) != 0)
         abort_on_error("Couldn't set graphic mode!")

      /* Now we are guaranteed to be able to read the keyboard. */
      readkey();


The abort_on_error function (which is not part of Allegro, I suppose it's supposed to be a function created by the user?) does not have a semi-colon at the end of its line, and therefore this code snippet does not compile.  It should probably look like this (with the allegro_message function, instead?):


      allegro_init();
      install_timer();
      install_keyboard();
      /* We are not 100% sure we can read the keyboard yet! */
      if (set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0) != 0)
         allegro_message("Couldn't set graphic mode!");

      /* Now we are guaranteed to be able to read the keyboard. */
      readkey();


Thanks to all involved in creating this wonderful library, and its extensive documentation, too!


Mark Keller

markekeller@xxxxxxxxxx

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=1752387&group_id=5665




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/