#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 | getFirstBit (int zahl) |
| Count the number of zero bits on the LSB side of "zahl". | |
| char * | strrr (int a) |
| converts a to a string. | |
| char * | strrr (Uint32 a) |
| char * | strrr (double f) |
| converts a to a string. | |
| 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 UPDC32 | ( | octet, | |||
| crc | ) | (crc_32_tab[((crc) ^ (octet)) & 0xff] ^ ((crc) >> 8)) |
| typedef unsigned int UNS_32_BITS |
| double atof | ( | const std::string & | s | ) |
Definition at line 153 of file misc.cpp.
References atof().
Referenced by atof(), ResourcePlacementDialog::buttonEvent(), DoubleArrayProperty::operation_eq(), FloatProperty::operation_eq(), FloatProperty::operation_mult(), and IntegerProperty::operation_mult().
| int atoi | ( | const std::string & | s | ) |
Definition at line 148 of file misc.cpp.
References atoi().
Referenced by atoi(), ResourcePlacementDialog::buttonEvent(), tviewtext::evalcommand(), VersionIdentifier::fromString(), ReplayRecorderDialog::getASCFramerateLimit(), ReplayRecorderDialog::getFramerate(), getNumericVersion(), ReplayRecorderDialog::getQuality(), loadsinglemessagefile(), ASCImageArrayProperty::operation_eq(), IntegerArrayProperty::operation_eq(), SingleUnitSet::parseIDs(), SingleUnitSet::TranslationTable::parseString(), CopyMap::paste(), SingleUnitSet::read(), VehicleTypeRenderer::renderWidget(), ResourcePlacementDialog::ResourcePlacementDialog(), Password::setEncoded(), String2IntRangeVector(), and Password::write().
| int crc32buf | ( | const void * | vbuf, | |
| int | len | |||
| ) |
Definition at line 129 of file misc.cpp.
References UPDC32.
Referenced by Password::encodepassword().
| int getFirstBit | ( | int | zahl | ) |
Count the number of zero bits on the LSB side of "zahl".
Definition at line 45 of file misc.cpp.
References log().
Referenced by attackpossible(), attackpossible28(), attackpossible2n(), attackpossible2u(), MapRenderer::bitmappedHeight2pass(), ConstructBuildingCommand::buildingProductionPrerequisites(), UnitPropertyEditor::buttonpressed(), ContainerBase::calcShadowDist(), ColorConverter< 1, 4 >::ColorConverter(), Vehicle::decreaseMovement(), MapDisplayPG::displayAddons(), fieldAccessible(), DestructBuildingCommand::getFields(), Message::getFromText(), Vehicle::getHeightChange(), getheightdelta(), getmaxwindspeedforunit(), MessageLineWidget::getName(), GuiFunctions::AttackGui::getName(), SingleWeapon::getScalarWeaponType(), AStar::getTravelTime(), Vehicle::getValueType(), WeapDist::getWeaponStrength(), Vehicle::hasMoved(), tsearchreactionfireingunits::init(), ColorMerger_AlphaHandler< 4 >::init(), Vehicle::maxMovement(), AttackPanel::painter(), ContainerBase::paintField(), BuildingType::read(), AiParameter::reset(), Vehicle::resetMovement(), MoveUnit::runAction(), MoveUnitCommand::searchFields(), Vehicle::setMovement(), AiParameter::setNewHeight(), stu_height(), Vehicle::vehicleconstructable(), and ContainerBase::vehicleLoadable().
| char* itoa | ( | int | a, | |
| char * | b, | |||
| int | c | |||
| ) |
Definition at line 175 of file misc.cpp.
Referenced by tdialogbox::disablebutton(), tdialogbox::enablebutton(), int2string(), tdialogbox::intedit(), DataTab::setData(), strrd8d(), strrd8n(), strrd8u(), strrr(), strrrd8d(), strrrd8n(), and strrrd8u().
| char* strrr | ( | double | a | ) |
| char* strrr | ( | int | a | ) |
converts a to a string.
Definition at line 60 of file misc.cpp.
Referenced by tplayerchange::anzeige(), TextPropertyList::buildIDs(), TextPropertyGroup::buildInheritance(), duplicateIDError(), editResearch(), editResearchPoints(), editTechAdapter(), Password::encodedpassword2string(), GuiFunctions::EndTurn::execute(), executeUserAction(), 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(), selectPlayer(), AI::showFieldInformation(), showPlayerTime(), StreamCompressionError::StreamCompressionError(), IntRangeArrayProperty::toString(), IntegerArrayProperty::toString(), IntegerProperty::toString(), and writeGameParametersToString().
| char* strupr | ( | const char * | a | ) |
Definition at line 160 of file misc.cpp.
References malloc().
Referenced by ASCStringHelpers::_Strupr().
UNS_32_BITS crc_32_tab[] [static] |
| const char* digit[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" } |
| const char* letter[] |
1.5.1