Skip to content
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

Hi! I cleaned up your code for you! #3

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
0.21b:
* Fixed windows build.

0.21:
0.21:
* Some documentation fixes.

0.20:
Expand Down
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ options:
Elasticity of nodes.

-b, --background-colour FFFFFF
Background colour in hex.
Background colour in hex.

--background-image IMAGE
Set a background image.
Expand Down Expand Up @@ -151,7 +151,7 @@ options:
Filter out any users matching a specified regular expression.

--user-image-dir DIRECTORY
Directory containing .jpg or .png images of users
Directory containing .jpg or .png images of users
(eg 'Full Name.png') to use as avatars.

--default-user-image IMAGE
Expand Down Expand Up @@ -311,7 +311,7 @@ version control systems:
Interface:

The time shown in the top left of the screen is set initially from the first
log entry read and is incremented according to the simulation speed
log entry read and is incremented according to the simulation speed
(--seconds-per-day).

Pressing SPACE at any time will pause/unpause the simulation. While paused you
Expand Down
6 changes: 3 additions & 3 deletions data/fonts/README
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Design Issues
Which font shapes should be made? Historical style terms like Renaissance
or Baroque letterforms cannot be applied beyond Latin/Cyrillic/Greek
scripts to any greater extent than Kufi or Nashki can be applied beyond
Arabic script; "italic" is really only meaningful for Latin letters.
Arabic script; "italic" is really only meaningful for Latin letters.

However, most modern writing systems have typographic formulations for
contrasting uniform and modulated character stroke widths, and have some
Expand Down Expand Up @@ -88,14 +88,14 @@ wish to do so, delete this exception statement from your version.
Files and their suffixes
------------------------

The files with .sfd (Spline Font Database) are in FontForge's native format.
The files with .sfd (Spline Font Database) are in FontForge's native format.
Please use these if you plan to modify the font files.

TrueType fonts for immediate consumption are the files with the .ttf
(TrueType Font) suffix. These are ready to use in Xwindows based
systems using FreeType, on Mac OS, and on older Windows systems.

OpenType fonts (with suffix .otf) are for use in Windows Vista.
OpenType fonts (with suffix .otf) are for use in Windows Vista.
Note that although they can be installed on Linux, but many applications
in Linux still don't support them.

Expand Down
6 changes: 3 additions & 3 deletions dev/bin/build_win32.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ sub gource_version {

sub doit {
my $cmd = shift;

if(system($cmd) != 0) {
die("command '$cmd' failed: $!");
}
}

sub dosify {
my($src, $dest) = @_;

my $content = `cat $src`;
$content =~ s/\r?\n/\r\n/g;

open OUTPUT, ">$dest" or die("$!");
print OUTPUT $content;
close OUTPUT;
Expand Down
6 changes: 3 additions & 3 deletions m4/pkg.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
#
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -39,7 +39,7 @@ if test -n "$PKG_CONFIG"; then
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi

fi[]dnl
])# PKG_PROG_PKG_CONFIG

Expand Down Expand Up @@ -120,7 +120,7 @@ if test $pkg_failed = yes; then
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
else
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
fi
# Put the nasty error message in config.log where it belongs
Expand Down
8 changes: 4 additions & 4 deletions m4/sdl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
dnl
AC_DEFUN([AM_PATH_SDL],
[dnl
[dnl
dnl Get the cflags and libraries from the sdl-config script
dnl
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
Expand Down Expand Up @@ -73,15 +73,15 @@ char*
my_strdup (char *str)
{
char *new_str;

if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;

return new_str;
}

Expand Down Expand Up @@ -128,7 +128,7 @@ int main (int argc, char *argv[])
fi
if test "x$no_sdl" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$SDL_CONFIG" = "no" ; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/gource-ps.pl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ sub _win32_proc_list {
my $username = $winproc->{Owner} || 'System';
my $time = $winproc->{UserModeTime};

$username =~ s/^.+\\//;
$username =~ s/^.+\\//;
$command =~ s/\.exe$//i;

next unless $command && $pid && $username;
Expand Down
34 changes: 17 additions & 17 deletions src/cvs2cl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ bool CVS2CLCommitLog::parseCommit(RCommit& commit) {
//if so find the first logentry tag

bool found_logentry = false;

while(getNextLine(line)) {
if(cvs2cl_logentry_start.match(line)) {
found_logentry = true;
break;
}
}

if(!found_logentry) return false;
if(!found_logentry) return false;
}

//fprintf(stderr,"found logentry\n");
Expand All @@ -67,7 +67,7 @@ bool CVS2CLCommitLog::parseCommit(RCommit& commit) {
//fprintf(stderr,"found opening tag\n");

bool endfound = false;

while(getNextLine(line)) {
logentry.append(line);
logentry.append("\n");
Expand All @@ -88,11 +88,11 @@ bool CVS2CLCommitLog::parseCommit(RCommit& commit) {
if(!doc.Parse(logentry.c_str())) return false;

//fprintf(stderr,"try to parse logentry: %s\n", logentry.c_str());

TiXmlElement* leE = doc.FirstChildElement( "entry" );

std::vector<std::string> entries;

if(!leE) return false;

//parse date
Expand All @@ -104,7 +104,7 @@ bool CVS2CLCommitLog::parseCommit(RCommit& commit) {

if(!cvs2cl_logentry_timestamp.match(timestamp_str, &entries))
return false;

struct tm time_str;

time_str.tm_year = atoi(entries[0].c_str()) - 1900;
Expand All @@ -115,24 +115,24 @@ bool CVS2CLCommitLog::parseCommit(RCommit& commit) {
time_str.tm_sec = atoi(entries[5].c_str());
time_str.tm_isdst = -1;

commit.timestamp = mktime(&time_str);
commit.timestamp = mktime(&time_str);

//parse author
TiXmlElement* authorE = leE->FirstChildElement("author");

if(authorE != 0) {

std::string author(authorE->GetText());

if(author.empty()) author = "Unknown";

commit.username = author;
}

//parse changes

for(TiXmlElement* fileE = leE->FirstChildElement("file"); fileE != 0; fileE = fileE->NextSiblingElement()) {

TiXmlElement* state = fileE->FirstChildElement("cvsstate");
TiXmlElement* name = fileE->FirstChildElement("name");

Expand All @@ -143,13 +143,13 @@ bool CVS2CLCommitLog::parseCommit(RCommit& commit) {
std::string file(name->GetText());

if(file.empty()) continue;

commit.addFile(file, status);
}

//fprintf(stderr,"parsed logentry\n");

//read files

return true;
}
8 changes: 4 additions & 4 deletions src/dirnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ RDirNode* RDirNode::getParent() const{


bool RDirNode::isDir(const std::string& path) const {

if(prefixedBy(path)) return true;

if(path.find(abspath) != 0) return false;

for(std::list<RDirNode*>::const_iterator it = children.begin(); it != children.end(); it++) {
if((*it)->isDir(path)) return true;
}
Expand All @@ -167,7 +167,7 @@ void RDirNode::findDirs(const std::string& path, std::list<RDirNode*>& dirs) {
dirs.push_back(this);
return;
}

for(std::list<RDirNode*>::const_iterator it = children.begin(); it != children.end(); it++) {
(*it)->findDirs(path, dirs);
}
Expand Down Expand Up @@ -418,7 +418,7 @@ bool RDirNode::addFile(RFile* f) {

for(std::list<RFile*>::const_iterator it = files.begin(); it != files.end(); it++) {
RFile* file = (*it);

if(f->path.find(file->fullpath) == 0) {
//fprintf(stderr, "removing %s as is actually the directory of %s\n", file->fullpath.c_str(), f->fullpath.c_str());
file->remove(true);
Expand Down
2 changes: 1 addition & 1 deletion src/dirnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class RDirNode : public QuadItem {
void logic(float dt);

void updateEdgeVBO(quadbuf& buffer) const;

void drawEdges() const;
void drawEdgeShadows() const;

Expand Down
16 changes: 8 additions & 8 deletions src/gource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ void Gource::writeCustomLog(const std::string& logfile, const std::string& outpu
}

bool Gource::findRepository(boost::filesystem::path& dir, std::string& log_format) {
dir = absolute(dir);

dir = absolute(dir);

//fprintf(stderr, "find repository from initial path: %s\n", dir.string().c_str());

while(is_directory(dir)) {

if(is_directory(dir / ".git")) log_format = "git";
Expand All @@ -197,12 +197,12 @@ bool Gource::findRepository(boost::filesystem::path& dir, std::string& log_forma
//fprintf(stderr, "found '%s' repository at: %s\n", log_format.c_str(), dir.string().c_str());
return true;
}

if(!dir.has_parent_path()) return false;

dir = dir.parent_path();
}

return false;
}

Expand All @@ -212,7 +212,7 @@ RCommitLog* Gource::determineFormat(std::string logfile) {
RCommitLog* clog = 0;

std::string log_format = gGourceSettings.log_format;

//if the log format is not specified and 'logfile' is a directory, recursively look for a version control repository.
//this method allows for something strange like someone who having an svn repository inside a git repository
//(in which case it would pick the svn directory as it would encounter that first)
Expand All @@ -230,7 +230,7 @@ RCommitLog* Gource::determineFormat(std::string logfile) {
} catch(boost::filesystem3::filesystem_error& error) {
}
}

//we've been told what format to use
if(log_format.size() > 0) {
debugLog("log-format = %s\n", log_format.c_str());
Expand Down
8 changes: 4 additions & 4 deletions src/gource.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ class Gource : public SDLApp {

void toggleCameraMode();


static bool findRepository(boost::filesystem::path& dir, std::string& log_format);

static RCommitLog* determineFormat(std::string logfile);

void updateCamera(float dt);
Expand All @@ -248,11 +248,11 @@ class Gource : public SDLApp {
void drawBackground(float dt);

void drawScene(float dt);

void updateVBOs(float dt);

void updateAndDrawEdges();

void drawFileShadows(float dt);
void drawUserShadows(float dt);
void drawActions(float dt);
Expand Down
2 changes: 1 addition & 1 deletion src/gource_shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void GourceShell::update(float t, float dt) {

if(gource == 0 || gource->isFinished()) {
gource = getNext();

if(gource==0) appFinished=true;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gource_shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class GourceShell : public SDLApp {
bool next;

GLuint transition_texture;
float transition_interval;
float transition_interval;

FrameExporter* exporter;
ConfFile* conf;
Expand Down
Loading