comments with space

This commit is contained in:
root
2022-04-12 23:03:20 +03:00
parent 41f32f4f8c
commit 662cb7fc40
22 changed files with 76 additions and 75 deletions

View File

@@ -16,7 +16,7 @@ void StringBuilder_append_string(StringBuilder* b, StringFragment s);
void StringBuilder_append_int64(StringBuilder* b, int64 a);
void StringBuilder_append_uint64(StringBuilder* b, uint64 a);
void StringBuilder_append_double(StringBuilder* b, double a);
//returns StringFragment with '\0' at the end
// returns StringFragment with '\0' at the end
StringFragment StringBuilder_build(StringBuilder* b);
#if __cplusplus

View File

@@ -1,6 +1,6 @@
#include "StringFragment.h"
//copies <length> characters from <ptr+offset> to new StringFragment (adding '\0' at the end)
// copies <length> characters from <ptr+offset> to new StringFragment (adding '\0' at the end)
StringFragment StringFragment_extract(StringFragment str){
if(str.length==0) return stringNull;
StringFragment extr={
@@ -15,7 +15,7 @@ StringFragment StringFragment_extract(StringFragment str){
return extr;
}
//compares two strings, NullPtr-friendly
// compares two strings, NullPtr-friendly
bool StringFragment_compare(StringFragment str0, StringFragment str1){
if(str0.length!=str1.length) return false;
if(!str0.ptr) return str1.ptr ? false : true;
@@ -28,7 +28,7 @@ bool StringFragment_compare(StringFragment str0, StringFragment str1){
return true;
}
//creates new StringFragment which is reversed variant of <s>
// creates new StringFragment which is reversed variant of <s>
StringFragment StringFragment_reverse(StringFragment s){
if(s.length==0) return s;
StringFragment r={

View File

@@ -6,22 +6,22 @@ extern "C" {
#include "../base/base.h"
//part of string
// part of string
typedef struct StringFragment{
char* ptr; //may be without '\0' at the end
char* ptr; // may be without '\0' at the end
uint32 offset;
uint32 length;
} StringFragment;
static const StringFragment stringNull={NULL,0,0};
//copies <length> characters from <ptr+offset> to new StringFragment (adding '\0' at the end)
// copies <length> characters from <ptr+offset> to new StringFragment (adding '\0' at the end)
StringFragment StringFragment_extract(StringFragment str);
//compares two strings, NullPtr-friendly
// compares two strings, NullPtr-friendly
bool StringFragment_compare(StringFragment str0, StringFragment str1);
//creates new StringFragment which is reversed variant of <s>
// creates new StringFragment which is reversed variant of <s>
StringFragment StringFragment_reverse(StringFragment s);
#if __cplusplus