-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codechange: Remove using namespace std;
#41
Open
PeterN
wants to merge
1
commit into
OpenTTD:master
Choose a base branch
from
PeterN:remove-using-std
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+362
−386
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,6 @@ | |
#include<errno.h> | ||
#include<cstdlib> | ||
|
||
using namespace std; | ||
|
||
#include"nforenum.h" | ||
#include"inlines.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -23,21 +23,20 @@ | |||||
#include<cassert> | ||||||
#include<sstream> | ||||||
|
||||||
using namespace std; | ||||||
|
||||||
#include"nforenum.h" | ||||||
#include"pseudo.h" | ||||||
#include"messages.h" | ||||||
#include"strings.h" | ||||||
#include"command.h" | ||||||
|
||||||
static bool Check14(PseudoSprite&data, uint&offset, vector<uint>&idstack) | ||||||
static bool Check14(PseudoSprite&data, uint&offset, std::vector<uint>&idstack) | ||||||
{ | ||||||
/* NFORenum reads the NFO, which is a text file. As per definition the | ||||||
* NFO is LE ordered. If characters are interpreted as bytes they will | ||||||
* therefore be read in LE order. ExtractDword does interpret the | ||||||
* characters as bytes and construct a host endian ordered integer. | ||||||
* Consequently, there is no need to swap endian for the read data; it | ||||||
* characters as bytes and construct a host endian ordered integer. | ||||||
* Consequently, there is no need to std::swap endian for the read data; it | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* will always be in the host order, or the constant below as long as | ||||||
* they have the expected integer value, thus reverse due to LE. */ | ||||||
static const uint ID_INFO = 0x4F464E49; // INFO in reverse order (LE) | ||||||
|
@@ -94,7 +93,7 @@ static bool Check14(PseudoSprite&data, uint&offset, vector<uint>&idstack) | |||||
|
||||||
void Check14(PseudoSprite&data) | ||||||
{ | ||||||
vector<uint>idstack; | ||||||
std::vector<uint>idstack; | ||||||
uint offset = 1; | ||||||
Check14(data, offset, idstack); | ||||||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -24,7 +24,6 @@ | |||||
#include<cassert> | ||||||
#include<errno.h> | ||||||
|
||||||
using namespace std; | ||||||
|
||||||
#include"nforenum.h" | ||||||
#include"sanity.h" | ||||||
|
@@ -41,15 +40,15 @@ extern bool _base_grf; | |||||
class c5{ | ||||||
public: | ||||||
int maxFeature(){return (int)sizes.size()+3;} | ||||||
const vector<int>&operator[](int x)const {return sizes[x-4];} | ||||||
const std::vector<int>&operator[](int x)const {return sizes[x-4];} | ||||||
SINGLETON(c5) | ||||||
private: | ||||||
vector<vector<int> >sizes; | ||||||
std::vector<std::vector<int> >sizes; | ||||||
}; | ||||||
|
||||||
c5::c5(){ | ||||||
FILE*pFile=myfopen(5); | ||||||
vector<int> temp; | ||||||
std::vector<int> temp; | ||||||
int ch, count, opts, flags; | ||||||
while((ch=GetCheckByte(5))!=0){ | ||||||
flags = 0; | ||||||
|
@@ -72,9 +71,9 @@ c5::c5(){ | |||||
} | ||||||
|
||||||
// I finally want to do runtime-generated varargs calls. | ||||||
// But I can't, so I have to manually generate the string instead. | ||||||
void Act5CountWarn(const vector<int>&sizes){ | ||||||
string str = mysprintf("%S",ACT5_SIZE, sizes[1], sizes[1]); | ||||||
// But I can't, so I have to manually generate the std::string instead. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
void Act5CountWarn(const std::vector<int>&sizes){ | ||||||
std::string str = mysprintf("%S",ACT5_SIZE, sizes[1], sizes[1]); | ||||||
int count=(int)sizes.size()-1; | ||||||
switch(count){ | ||||||
case 1: | ||||||
|
@@ -101,7 +100,7 @@ int Check5(PseudoSprite&data,sanstate&state){ | |||||
IssueMessage(FATAL,INVALID_FEATURE); | ||||||
return sprites; | ||||||
} | ||||||
const vector<int>&expSprites=c5::Instance()[feature]; | ||||||
const std::vector<int>&expSprites=c5::Instance()[feature]; | ||||||
if(!hasoffset){ | ||||||
for(int i=(int)expSprites.size();--i;){ // Test [1] ... [.size()-1] | ||||||
if(expSprites[i] == 0)goto countok; | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ | |
#include<cassert> | ||
#include<algorithm> | ||
|
||
using namespace std; | ||
|
||
#include"nforenum.h" | ||
#include"inlines.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ | |
#include<fstream> | ||
#include<string> | ||
|
||
using namespace std; | ||
|
||
#include"nforenum.h" | ||
#include"inlines.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.