Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

misc.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <ctype.h>
#include <stdarg.h>
#include <iostream>
#include <SDL.h>
#include "global.h"
#include "misc.h"
#include "ascstring.h"

Include dependency graph for misc.cpp:

Go to the source code of this file.

Defines

#define UPDC32(octet, crc)   (crc_32_tab[((crc) ^ (octet)) & 0xff] ^ ((crc) >> 8))

Typedefs

typedef unsigned int UNS_32_BITS

Functions

int firstBit (int zahl)
char * strr (int a)
 converts a to a string.
char * strrr (int a)
 converts a to a string.
char * strrr (Uint32 a)
char * strrr (double f)
 converts a to a string.
void beep (void)
int crc32buf (const void *vbuf, int len)
int atoi (const std::string &s)
double atof (const std::string &s)
char * strupr (const char *a)
char * itoa (int a, char *b, int c)

Variables

const char * digit [] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }
const char * letter []
char strstring [1000]
static UNS_32_BITS crc_32_tab []


Define Documentation

#define UPDC32 octet,
crc   )     (crc_32_tab[((crc) ^ (octet)) & 0xff] ^ ((crc) >> 8))
 

Definition at line 139 of file misc.cpp.

Referenced by crc32buf().


Typedef Documentation

typedef unsigned int UNS_32_BITS
 

Definition at line 89 of file misc.cpp.


Function Documentation

double atof const std::string &  s  ) 
 

Definition at line 166 of file misc.cpp.

References atof().

Referenced by atof(), ResourcePlacementDialog::buttonEvent(), DoubleArrayProperty::operation_eq(), FloatProperty::operation_eq(), FloatProperty::operation_mult(), IntegerProperty::operation_mult(), and SetProgressBarAtts().

int atoi const std::string &  s  ) 
 

Definition at line 161 of file misc.cpp.

References atoi().

Referenced by atoi(), ResourcePlacementDialog::buttonEvent(), checkFileVersion(), tviewtext::evalcommand(), ReplayRecorderDialog::getFramerate(), getNumericVersion(), ReplayRecorderDialog::getQuality(), PG_SpinnerBox::handleEditEnd(), loadsinglemessagefile(), ASCImageArrayProperty::operation_eq(), IntegerArrayProperty::operation_eq(), SingleUnitSet::parseIDs(), parseObjectProps(), SingleUnitSet::TranslationTable::parseString(), parseThemeProps(), CopyMap::paste(), PG_Layout::GetParamInt(), PG_Layout::GetParamScrollDirection(), SingleUnitSet::read(), VehicleTypeRenderer::renderWidget(), ResourcePlacementDialog::ResourcePlacementDialog(), Password::setEncoded(), String2IntRangeVector(), and Password::write().

void beep void   ) 
 

Definition at line 83 of file misc.cpp.

int crc32buf const void *  vbuf,
int  len
 

Definition at line 142 of file misc.cpp.

References UPDC32.

Referenced by Password::encodepassword().

int firstBit int  zahl  ) 
 

Definition at line 45 of file misc.cpp.

Referenced by ColorConverter< 1, 4 >::ColorConverter(), ColorMerger_AlphaHandler< 4 >::init(), and log2().

char* itoa int  a,
char *  b,
int  c
 

Definition at line 188 of file misc.cpp.

Referenced by tdialogbox::disablebutton(), tdialogbox::enablebutton(), int2string(), tdialogbox::intedit(), strr(), strrd8d(), strrd8n(), strrd8u(), strrr(), strrrd8d(), strrrd8n(), and strrrd8u().

char* strr int  a  ) 
 

converts a to a string.

Returns:
a pointer to a newly allocated array of characters, which must be freed with delete[]

Definition at line 59 of file misc.cpp.

References itoa().

Referenced by tshowhistorypaintstat().

char* strrr double  a  ) 
 

converts a to a string.

Returns:
a pointer to a static array, which will be overwritten in the next call

Definition at line 77 of file misc.cpp.

References strstring.

char* strrr Uint32  a  ) 
 

Definition at line 72 of file misc.cpp.

References strstring.

char* strrr int  a  ) 
 

converts a to a string.

Returns:
a pointer to a static array, which will be overwritten in the next call

Definition at line 67 of file misc.cpp.

Referenced by tplayerchange::anzeige(), TextPropertyList::buildIDs(), TextPropertyGroup::buildInheritance(), duplicateIDError(), editResearch(), editResearchPoints(), editTechAdapter(), Password::encodedpassword2string(), execuseraction(), GuiFunctions::EndTurn::execute(), generateTechLabel(), generateTechName(), getVersionString(), tplayerselall::init(), tresearchinfo::init(), UnitPropertyEditor::init(), tplayerchange::init(), tmapgenerator::init(), thelpsystem::init(), int2string(), MiningStation::MiningStation(), Vehicletype::HeightChangeMethod::read(), ContainerBaseType::TransportationIO::read(), ContainerBaseType::read(), readtextmessage(), resourceComparison(), UnitTypeTransformation::run(), SingleWeapon::runTextIO(), Vehicletype::runTextIO(), TerrainType::Weather::runTextIO(), ObjectType::runTextIO(), CGameOptions::runTextIO(), ContainerBaseType::runTextIO(), BuildingType::runTextIO(), AI::showFieldInformation(), showPlayerTime(), tcompressionerror::tcompressionerror(), IntRangeArrayProperty::toString(), IntegerArrayProperty::toString(), IntegerProperty::toString(), and writeGameParametersToString().

char* strupr const char *  a  ) 
 

Definition at line 173 of file misc.cpp.

References malloc().

Referenced by ASCStringHelpers::_Strupr().


Variable Documentation

UNS_32_BITS crc_32_tab[] [static]
 

Definition at line 92 of file misc.cpp.

const char* digit[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }
 

Definition at line 37 of file misc.cpp.

Referenced by int2string().

const char* letter[]
 

Initial value:

 { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", 
                         "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }

Definition at line 38 of file misc.cpp.

char strstring[1000]
 

Definition at line 42 of file misc.cpp.

Referenced by strrr().


Generated on Tue Jun 24 01:52:52 2008 for Advanced Strategic Command by  doxygen 1.4.2