Eliminate the use of C++ keyword 'template'; bug #1131; from Scott A. Colcord
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3693 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -70,12 +70,12 @@ static TFB_GRAPHICS_BACKEND opengl_unscaled_backend = {
|
||||
|
||||
|
||||
static SDL_Surface *
|
||||
Create_Screen (SDL_Surface *template, int w, int h)
|
||||
Create_Screen (SDL_Surface *templat, int w, int h)
|
||||
{
|
||||
SDL_Surface *newsurf = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h,
|
||||
template->format->BitsPerPixel,
|
||||
template->format->Rmask, template->format->Gmask,
|
||||
template->format->Bmask, 0);
|
||||
templat->format->BitsPerPixel,
|
||||
templat->format->Rmask, templat->format->Gmask,
|
||||
templat->format->Bmask, 0);
|
||||
if (newsurf == 0) {
|
||||
log_add (log_Error, "Couldn't create screen buffers: %s",
|
||||
SDL_GetError());
|
||||
@@ -84,11 +84,11 @@ Create_Screen (SDL_Surface *template, int w, int h)
|
||||
}
|
||||
|
||||
static int
|
||||
ReInit_Screen (SDL_Surface **screen, SDL_Surface *template, int w, int h)
|
||||
ReInit_Screen (SDL_Surface **screen, SDL_Surface *templat, int w, int h)
|
||||
{
|
||||
if (*screen)
|
||||
SDL_FreeSurface (*screen);
|
||||
*screen = Create_Screen (template, w, h);
|
||||
*screen = Create_Screen (templat, w, h);
|
||||
|
||||
return *screen == 0 ? -1 : 0;
|
||||
}
|
||||
|
||||
@@ -48,12 +48,12 @@ static TFB_GRAPHICS_BACKEND pure_unscaled_backend = {
|
||||
TFB_Pure_ColorLayer };
|
||||
|
||||
static SDL_Surface *
|
||||
Create_Screen (SDL_Surface *template, int w, int h)
|
||||
Create_Screen (SDL_Surface *templat, int w, int h)
|
||||
{
|
||||
SDL_Surface *newsurf = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h,
|
||||
template->format->BitsPerPixel,
|
||||
template->format->Rmask, template->format->Gmask,
|
||||
template->format->Bmask, 0);
|
||||
templat->format->BitsPerPixel,
|
||||
templat->format->Rmask, templat->format->Gmask,
|
||||
templat->format->Bmask, 0);
|
||||
if (newsurf == 0) {
|
||||
log_add (log_Error, "Couldn't create screen buffers: %s",
|
||||
SDL_GetError());
|
||||
@@ -62,11 +62,11 @@ Create_Screen (SDL_Surface *template, int w, int h)
|
||||
}
|
||||
|
||||
static int
|
||||
ReInit_Screen (SDL_Surface **screen, SDL_Surface *template, int w, int h)
|
||||
ReInit_Screen (SDL_Surface **screen, SDL_Surface *templat, int w, int h)
|
||||
{
|
||||
if (*screen)
|
||||
SDL_FreeSurface (*screen);
|
||||
*screen = Create_Screen (template, w, h);
|
||||
*screen = Create_Screen (templat, w, h);
|
||||
|
||||
return *screen == 0 ? -1 : 0;
|
||||
}
|
||||
|
||||
@@ -53,9 +53,9 @@ UniChar GetLastCharacter (void);
|
||||
|
||||
/* Interrogating the current key configuration */
|
||||
|
||||
void InterrogateInputState (int template, int control, int index, char *buffer, int maxlen);
|
||||
void RemoveInputState (int template, int control, int index);
|
||||
void RebindInputState (int template, int control, int index);
|
||||
void InterrogateInputState (int templat, int control, int index, char *buffer, int maxlen);
|
||||
void RemoveInputState (int templat, int control, int index);
|
||||
void RebindInputState (int templat, int control, int index);
|
||||
|
||||
void SaveKeyConfiguration (uio_DirHandle *path, const char *fname);
|
||||
|
||||
|
||||
@@ -420,11 +420,11 @@ TFB_ResetControls (void)
|
||||
}
|
||||
|
||||
void
|
||||
InterrogateInputState (int template, int control, int index, char *buffer, int maxlen)
|
||||
InterrogateInputState (int templat, int control, int index, char *buffer, int maxlen)
|
||||
{
|
||||
VCONTROL_GESTURE *g = CONTROL_PTR(template, control, index);
|
||||
VCONTROL_GESTURE *g = CONTROL_PTR(templat, control, index);
|
||||
|
||||
if (template >= num_templ || control >= num_flight
|
||||
if (templat >= num_templ || control >= num_flight
|
||||
|| index >= MAX_FLIGHT_ALTERNATES)
|
||||
{
|
||||
log_add (log_Warning, "InterrogateInputState(): invalid control index");
|
||||
@@ -457,13 +457,13 @@ InterrogateInputState (int template, int control, int index, char *buffer, int m
|
||||
}
|
||||
|
||||
void
|
||||
RemoveInputState (int template, int control, int index)
|
||||
RemoveInputState (int templat, int control, int index)
|
||||
{
|
||||
VCONTROL_GESTURE *g = CONTROL_PTR(template, control, index);
|
||||
VCONTROL_GESTURE *g = CONTROL_PTR(templat, control, index);
|
||||
char keybuf[40];
|
||||
keybuf[39] = '\0';
|
||||
|
||||
if (template >= num_templ || control >= num_flight
|
||||
if (templat >= num_templ || control >= num_flight
|
||||
|| index >= MAX_FLIGHT_ALTERNATES)
|
||||
{
|
||||
log_add (log_Warning, "RemoveInputState(): invalid control index");
|
||||
@@ -471,23 +471,23 @@ RemoveInputState (int template, int control, int index)
|
||||
}
|
||||
|
||||
VControl_RemoveGestureBinding (g,
|
||||
(int *)(flight_vec + template * num_flight + control));
|
||||
(int *)(flight_vec + templat * num_flight + control));
|
||||
g->type = VCONTROL_NONE;
|
||||
|
||||
snprintf (keybuf, 39, "keys.%d.%s.%d", template+1, flight_res_names[control], index+1);
|
||||
snprintf (keybuf, 39, "keys.%d.%s.%d", templat+1, flight_res_names[control], index+1);
|
||||
res_Remove (keybuf);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
RebindInputState (int template, int control, int index)
|
||||
RebindInputState (int templat, int control, int index)
|
||||
{
|
||||
VCONTROL_GESTURE g;
|
||||
char keybuf[40], valbuf[40];
|
||||
keybuf[39] = valbuf[39] = '\0';
|
||||
|
||||
if (template >= num_templ || control >= num_flight
|
||||
if (templat >= num_templ || control >= num_flight
|
||||
|| index >= MAX_FLIGHT_ALTERNATES)
|
||||
{
|
||||
log_add (log_Warning, "RebindInputState(): invalid control index");
|
||||
@@ -495,7 +495,7 @@ RebindInputState (int template, int control, int index)
|
||||
}
|
||||
|
||||
/* Remove the old binding on this spot */
|
||||
RemoveInputState (template, control, index);
|
||||
RemoveInputState (templat, control, index);
|
||||
|
||||
/* Wait for the next interesting bit of user input */
|
||||
VControl_ClearGesture ();
|
||||
@@ -506,9 +506,9 @@ RebindInputState (int template, int control, int index)
|
||||
|
||||
/* And now, add the new binding. */
|
||||
VControl_AddGestureBinding (&g,
|
||||
(int *)(flight_vec + template * num_flight + control));
|
||||
*CONTROL_PTR(template, control, index) = g;
|
||||
snprintf (keybuf, 39, "keys.%d.%s.%d", template+1, flight_res_names[control], index+1);
|
||||
(int *)(flight_vec + templat * num_flight + control));
|
||||
*CONTROL_PTR(templat, control, index) = g;
|
||||
snprintf (keybuf, 39, "keys.%d.%s.%d", templat+1, flight_res_names[control], index+1);
|
||||
VControl_DumpGesture (valbuf, 39, &g);
|
||||
res_PutString (keybuf, valbuf);
|
||||
}
|
||||
|
||||
@@ -321,18 +321,18 @@ do_advanced (WIDGET *self, int event)
|
||||
}
|
||||
|
||||
static void
|
||||
populate_editkeys (int template)
|
||||
populate_editkeys (int templat)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
strncpy (textentries[0].value, input_templates[template].name, textentries[0].maxlen);
|
||||
strncpy (textentries[0].value, input_templates[templat].name, textentries[0].maxlen);
|
||||
textentries[0].value[textentries[0].maxlen-1] = 0;
|
||||
|
||||
for (i = 0; i < NUM_KEYS; i++)
|
||||
{
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
InterrogateInputState (template, i, j, controlentries[i].controlname[j], WIDGET_CONTROLENTRY_WIDTH);
|
||||
InterrogateInputState (templat, i, j, controlentries[i].controlname[j], WIDGET_CONTROLENTRY_WIDTH);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -743,26 +743,26 @@ gamma_DrawValue (WIDGET_SLIDER *self, int x, int y)
|
||||
static void
|
||||
rebind_control (WIDGET_CONTROLENTRY *widget)
|
||||
{
|
||||
int template = choices[20].selected;
|
||||
int templat = choices[20].selected;
|
||||
int control = widget->controlindex;
|
||||
int index = widget->highlighted;
|
||||
|
||||
FlushInput ();
|
||||
DrawLabelAsWindow (&labels[3], NULL);
|
||||
RebindInputState (template, control, index);
|
||||
populate_editkeys (template);
|
||||
RebindInputState (templat, control, index);
|
||||
populate_editkeys (templat);
|
||||
FlushInput ();
|
||||
}
|
||||
|
||||
static void
|
||||
clear_control (WIDGET_CONTROLENTRY *widget)
|
||||
{
|
||||
int template = choices[20].selected;
|
||||
int templat = choices[20].selected;
|
||||
int control = widget->controlindex;
|
||||
int index = widget->highlighted;
|
||||
|
||||
RemoveInputState (template, control, index);
|
||||
populate_editkeys (template);
|
||||
RemoveInputState (templat, control, index);
|
||||
populate_editkeys (templat);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user