8000 removed superfluous member from stringbuffer struct by a2800276 · Pull Request #27 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

removed superfluous member from stringbuffer struct #27

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

Merged
merged 1 commit into from
Mar 14, 2012
Merged
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
3 changes: 0 additions & 3 deletions BasicsC/string-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,6 @@ void TRI_AppendDoubleStringBuffer (TRI_string_buffer_t * self, double attr) {
}
else if (attr == 0.0) {
AppendChar(self, '0');
*self->_bufferPtr = '\0';
return;
}

Expand Down Expand Up @@ -829,7 +828,6 @@ void TRI_AppendDoubleStringBuffer (TRI_string_buffer_t * self, double attr) {
if (pos > 2) { AppendChar(self, a3); }
if (pos > 3) { AppendChar(self, a4); }

*self->_bufferPtr = '\0';
}

return;
Expand Down Expand Up @@ -857,7 +855,6 @@ void TRI_AppendDoubleStringBuffer (TRI_string_buffer_t * self, double attr) {
AppendChar(self, '0');
}

*self->_bufferPtr = '\0';
return;
}

Expand Down
1 change: 0 additions & 1 deletion BasicsC/string-buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ extern "C" {

typedef struct TRI_string_buffer_s {
char * _buffer;
char * _bufferPtr;
ptrdiff_t _off;
size_t _len;
}
Expand Down
6 changes: 6 additions & 0 deletions UnitTests/string-buffer-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ void tst_smpl_utils () {
TRI_AppendInteger3StringBuffer(&sb, 1234);
cmp_str("234", sb._buffer, 1024, "append int3");


TRI_AppendDoubleStringBuffer(&sb, 12.0);
cmp_str("23412", sb._buffer, 1024, "append int3");

TRI_AppendDoubleStringBuffer(&sb, -12.125);
cmp_str("23412-12.125", sb._buffer, 1024, "append int3");
}

void tst_report () {
Expand Down
0