Skip to content
Snippets Groups Projects
Commit 655e3315 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Oups, big bug (bad placed i++)

parent 604b5642
No related branches found
No related tags found
No related merge requests found
// $Id: Context.cpp,v 1.37 2001-02-17 21:56:58 geuzaine Exp $ // $Id: Context.cpp,v 1.38 2001-02-19 11:54:28 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "Const.h" #include "Const.h"
...@@ -26,12 +26,18 @@ StringXString * Get_StringOptionCategory(char * cat){ ...@@ -26,12 +26,18 @@ StringXString * Get_StringOptionCategory(char * cat){
void Set_DefaultStringOptions(int num, StringXString s[]){ void Set_DefaultStringOptions(int num, StringXString s[]){
int i = 0; int i = 0;
while(s[i].str) s[i].function(num, GMSH_SET, s[i++].def) ; while(s[i].str){
s[i].function(num, GMSH_SET, s[i].def) ;
i++;
}
} }
void Set_StringOptions_GUI(int num, StringXString s[]){ void Set_StringOptions_GUI(int num, StringXString s[]){
int i = 0; int i = 0;
while(s[i].str) s[i++].function(num, GMSH_GUI, 0) ; while(s[i].str){
s[i].function(num, GMSH_GUI, 0) ;
i++;
}
} }
void * Get_StringOption(char *str, StringXString s[]){ void * Get_StringOption(char *str, StringXString s[]){
...@@ -69,12 +75,18 @@ StringXNumber * Get_NumberOptionCategory(char * cat){ ...@@ -69,12 +75,18 @@ StringXNumber * Get_NumberOptionCategory(char * cat){
void Set_DefaultNumberOptions(int num, StringXNumber s[]){ void Set_DefaultNumberOptions(int num, StringXNumber s[]){
int i = 0; int i = 0;
while(s[i].str) s[i].function(num, GMSH_SET, s[i++].def) ; while(s[i].str){
s[i].function(num, GMSH_SET, s[i].def) ;
i++;
}
} }
void Set_NumberOptions_GUI(int num, StringXNumber s[]){ void Set_NumberOptions_GUI(int num, StringXNumber s[]){
int i = 0; int i = 0;
while(s[i].str) s[i++].function(num, GMSH_GUI, 0) ; while(s[i].str){
s[i].function(num, GMSH_GUI, 0) ;
i++ ;
}
} }
void * Get_NumberOption(char *str, StringXNumber s[]){ void * Get_NumberOption(char *str, StringXNumber s[]){
...@@ -115,15 +127,33 @@ StringXColor * Get_ColorOptionCategory(char * cat){ ...@@ -115,15 +127,33 @@ StringXColor * Get_ColorOptionCategory(char * cat){
void Set_DefaultColorOptions(int num, StringXColor s[], int scheme){ void Set_DefaultColorOptions(int num, StringXColor s[], int scheme){
int i = 0; int i = 0;
switch(scheme){ switch(scheme){
case 0 : while(s[i].str) s[i].function(num, GMSH_SET, s[i++].def1) ; break; case 0 :
case 1 : while(s[i].str) s[i].function(num, GMSH_SET, s[i++].def2) ; break; while(s[i].str){
case 2 : while(s[i].str) s[i].function(num, GMSH_SET, s[i++].def3) ; break; s[i].function(num, GMSH_SET, s[i].def1) ;
i++;
}
break;
case 1 :
while(s[i].str){
s[i].function(num, GMSH_SET, s[i].def2) ;
i++;
}
break;
case 2 :
while(s[i].str){
s[i].function(num, GMSH_SET, s[i].def3) ;
i++;
}
break;
} }
} }
void Set_ColorOptions_GUI(int num, StringXColor s[]){ void Set_ColorOptions_GUI(int num, StringXColor s[]){
int i = 0; int i = 0;
while(s[i].str) s[i++].function(num, GMSH_GUI, 0) ; while(s[i].str){
s[i].function(num, GMSH_GUI, 0) ;
i++;
}
} }
void * Get_ColorOption(char *str, StringXColor s[]) { void * Get_ColorOption(char *str, StringXColor s[]) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment