GLSL fixes:
- generate error on NULL pointers in glShaderSourceARB;
- reinstall program object, if current, in glLinkProgramARB;
- vertex and fragment shaders are optional in program object;
- floor asm was wrongly computed for x86 back-end;
- allow for (void) idiom in function prototypes;
- all fixed-state uniforms are updated;
- local variable initializers are working;
- implement texture* and shadow* functions for vertex processor;
- generate error if too many arguments in general constructor;
- trim unused data in general constructor;
- struct r-value field select was badly relocated;

Changes:
- add derived state gl_fog_attrib::_Scale;
- add derived state gl_light::_CosCutoffNeg;
diff --git a/src/mesa/shader/shaderobjects.c b/src/mesa/shader/shaderobjects.c
index ad55b74..998d4e4 100644
--- a/src/mesa/shader/shaderobjects.c
+++ b/src/mesa/shader/shaderobjects.c
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.3
+ * Version:  6.5
  *
- * Copyright (C) 2004-2005  Brian Paul   All Rights Reserved.
+ * Copyright (C) 2004-2006  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -200,7 +200,14 @@
 	GET_SHADER(sha, shaderObj, "glShaderSourceARB");
 
 	if (sha == NULL)
-		return;
+		return;

+

+	if (string == NULL)

+	{

+		RELEASE_SHADER(sha);

+		_mesa_error (ctx, GL_INVALID_VALUE, "glShaderSourceARB");

+		return;

+	}
 
 	/*
 	 * This array holds offsets of where the appropriate string ends, thus the last
@@ -215,7 +222,14 @@
 	}
 
 	for (i = 0; i < count; i++)
-	{
+	{

+		if (string[i] == NULL)

+		{

+			_mesa_free ((GLvoid *) offsets);

+			RELEASE_SHADER(sha);

+			_mesa_error (ctx, GL_INVALID_VALUE, "glShaderSourceARB");

+			return;

+		}
 		if (length == NULL || length[i] < 0)
 			offsets[i] = _mesa_strlen (string[i]);
 		else
@@ -291,11 +305,14 @@
 
 	if (pro != NULL)
 	{
-		if (pro == ctx->ShaderObjects.CurrentProgram)
-		{
-			/* TODO re-install executable program */
+		(**pro).Link (pro);

+		if (pro == ctx->ShaderObjects.CurrentProgram)

+		{

+			if ((**pro).GetLinkStatus (pro))

+				_mesa_UseProgramObjectARB (programObj);

+			else

+				_mesa_UseProgramObjectARB (0);

 		}
-		(**pro).Link (pro);
 		RELEASE_PROGRAM(pro);
 	}
 }
@@ -309,7 +326,7 @@
 	FLUSH_VERTICES(ctx, _NEW_PROGRAM);
 
 	if (programObj != 0)
-	{
+	{

 		GET_PROGRAM(pro, programObj, "glUseProgramObjectARB");
 
 		if (pro == NULL)
@@ -322,7 +339,16 @@
 			return;
 		}
 
-		program = pro;
+		program = pro;

+

+		ctx->ShaderObjects._VertexShaderPresent = (**pro).IsShaderPresent (pro, GL_VERTEX_SHADER_ARB);

+		ctx->ShaderObjects._FragmentShaderPresent = (**pro).IsShaderPresent (pro,

+			GL_FRAGMENT_SHADER_ARB);
+	}

+	else

+	{

+		ctx->ShaderObjects._VertexShaderPresent = GL_FALSE;

+		ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE;

 	}
 
 	if (ctx->ShaderObjects.CurrentProgram != NULL)
@@ -1060,7 +1086,9 @@
 GLvoid
 _mesa_init_shaderobjects (GLcontext *ctx)
 {
-	ctx->ShaderObjects.CurrentProgram = NULL;
+	ctx->ShaderObjects.CurrentProgram = NULL;

+	ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE;

+	ctx->ShaderObjects._VertexShaderPresent = GL_FALSE;
 
 	_mesa_init_shaderobjects_3dlabs (ctx);
 }