logo       

Const correctness in the SI (part 1): msg#00034

Subject: Const correctness in the SI (part 1)
The attached patch fixes the const-correctness of _alIsZeroVector and 
_alcSetContext.
In addition, the first argument of the latter is made a little bit more correct
(ALCint vs. int).

Cheers,
   S.
Index: linux/src/al_main.c
===================================================================
RCS file: /usr/local/cvs-repository/openal/linux/src/al_main.c,v
retrieving revision 1.10
diff -u -r1.10 al_main.c
--- linux/src/al_main.c 19 Apr 2004 22:03:07 -0000      1.10
+++ linux/src/al_main.c 27 Feb 2005 14:53:49 -0000
@@ -785,11 +785,11 @@
 }
 
 /*
- * _alIsZeroVector( ALfloat *fv1 )
+ * ALboolean _alIsZeroVector( const ALfloat *fv1 )
  *
  * Returns true if fv1 == { 0.0f, 0.0f, 0.0f }
  */
-ALboolean _alIsZeroVector(ALfloat *fv)
+ALboolean _alIsZeroVector(const ALfloat *fv)
 {
        if(fv[0] != 0.0f) {
                return AL_FALSE;
Index: linux/src/al_main.h
===================================================================
RCS file: /usr/local/cvs-repository/openal/linux/src/al_main.h,v
retrieving revision 1.5
diff -u -r1.5 al_main.h
--- linux/src/al_main.h 10 Aug 2003 07:58:31 -0000      1.5
+++ linux/src/al_main.h 27 Feb 2005 14:53:49 -0000
@@ -278,11 +278,11 @@
 ALboolean _alCheckRangeb( ALboolean val );
 
 /*
- * _alIsZeroVector( ALfloat *fv1 )
+ * ALboolean _alIsZeroVector( const ALfloat *fv1 )
  *
  * Returns true if fv1 == { 0.0f, 0.0f, 0.0f }
  */
-ALboolean _alIsZeroVector( ALfloat *fv1 );
+ALboolean _alIsZeroVector( const ALfloat *fv1 );
 
 /*
  * the buffers that sources are split into in SplitSources and
Index: linux/src/alc/alc_context.c
===================================================================
RCS file: /usr/local/cvs-repository/openal/linux/src/alc/alc_context.c,v
retrieving revision 1.13
diff -u -r1.13 alc_context.c
--- linux/src/alc/alc_context.c 25 Jun 2004 18:47:20 -0000      1.13
+++ linux/src/alc/alc_context.c 27 Feb 2005 14:53:51 -0000
@@ -614,12 +614,12 @@
 
 
 /*
- * _alcSetContext( int *attrlist, ALuint cid, AL_device *dev )
+ * void _alcSetContext( const ALCint *attrlist, ALuint cid, AL_device *dev )
  *
  * Sets context id paramaters according to an attribute list and device.
  *
  */
-void _alcSetContext(int *attrlist, ALuint cid, AL_device *dev ) {
+void _alcSetContext(const ALCint *attrlist, ALuint cid, AL_device *dev ) {
        AL_context *cc;
        ALboolean reading_keys = AL_TRUE;
        struct { int key; int val; } rdr;
Index: linux/src/alc/alc_context.h
===================================================================
RCS file: /usr/local/cvs-repository/openal/linux/src/alc/alc_context.h,v
retrieving revision 1.3
diff -u -r1.3 alc_context.h
--- linux/src/alc/alc_context.h 20 Jun 2003 19:23:06 -0000      1.3
+++ linux/src/alc/alc_context.h 27 Feb 2005 14:53:51 -0000
@@ -9,6 +9,7 @@
 #define _ALC_CONTEXT_H_
 
 #include "AL/altypes.h"
+#include "AL/alctypes.h"
 
 #include "../al_types.h"
 #include "../al_attenuation.h"
@@ -90,11 +91,11 @@
 ALboolean _alcIsContext( ALuint cid );
 
 /*
- * _alcSetContext( int *attrlist, ALuint cid, AL_device *dev )
+ * void _alcSetContext( const ALCint *attrlist, ALuint cid, AL_device *dev )
  *
  * Sets context id paramaters according to an attribute list and device.
  */
-void _alcSetContext( int *attrlist, ALuint cid, AL_device *dev );
+void _alcSetContext( const ALCint *attrlist, ALuint cid, AL_device *dev );
 
 /*
  * _alcGetNewContextId( void )
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe