Formatted all .cc and .h code in rtengine, rtexif and rtgui using astyle

This commit is contained in:
DrSlony
2015-08-11 11:55:03 +02:00
parent effb46c3e1
commit 0e0cfb9b25
452 changed files with 133354 additions and 99460 deletions

View File

@@ -7,7 +7,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -24,15 +24,15 @@
#include <cstring>
#include "rtengine.h"
struct IMFILE {
int fd;
ssize_t pos;
ssize_t size;
char* data;
bool eof;
rtengine::ProgressListener *plistener;
double progress_range;
ssize_t progress_next;
ssize_t progress_current;
int fd;
ssize_t pos;
ssize_t size;
char* data;
bool eof;
rtengine::ProgressListener *plistener;
double progress_range;
ssize_t progress_next;
ssize_t progress_current;
};
/*
@@ -44,74 +44,89 @@ void imfile_set_plistener(IMFILE *f, rtengine::ProgressListener *plistener, doub
void imfile_update_progress(IMFILE *f);
IMFILE* fopen (const char* fname);
IMFILE* gfopen (const char* fname);IMFILE* fopen (unsigned* buf, int size);
IMFILE* gfopen (const char* fname);
IMFILE* fopen (unsigned* buf, int size);
void fclose (IMFILE* f);
inline int ftell (IMFILE* f) {
inline int ftell (IMFILE* f)
{
return f->pos;
return f->pos;
}
inline int feof (IMFILE* f) {
inline int feof (IMFILE* f)
{
return f->eof;
return f->eof;
}
inline void fseek (IMFILE* f, int p, int how) {
int fpos = f->pos;
inline void fseek (IMFILE* f, int p, int how)
{
int fpos = f->pos;
if (how==SEEK_SET)
f->pos = p;
else if (how==SEEK_CUR)
f->pos += p;
else if (how==SEEK_END)
f->pos = f->size+p;
if (how == SEEK_SET) {
f->pos = p;
} else if (how == SEEK_CUR) {
f->pos += p;
} else if (how == SEEK_END) {
f->pos = f->size + p;
}
if (f->pos < 0 || f->pos> f->size)
f->pos = fpos;
if (f->pos < 0 || f->pos > f->size) {
f->pos = fpos;
}
}
inline int fgetc (IMFILE* f) {
inline int fgetc (IMFILE* f)
{
if (f->pos<f->size) {
if (f->plistener && ++f->progress_current >= f->progress_next) {
imfile_update_progress(f);
}
return (unsigned char)f->data[f->pos++];
}
f->eof = true;
return EOF;
if (f->pos < f->size) {
if (f->plistener && ++f->progress_current >= f->progress_next) {
imfile_update_progress(f);
}
return (unsigned char)f->data[f->pos++];
}
f->eof = true;
return EOF;
}
inline int getc (IMFILE* f) {
inline int getc (IMFILE* f)
{
return fgetc(f);
return fgetc(f);
}
inline int fread (void* dst, int es, int count, IMFILE* f) {
inline int fread (void* dst, int es, int count, IMFILE* f)
{
int s = es*count;
int avail = f->size - f->pos;
if (s<=avail) {
memcpy (dst, f->data+f->pos, s);
f->pos += s;
if (f->plistener) {
f->progress_current += s;
if (f->progress_current >= f->progress_next) {
imfile_update_progress(f);
}
}
return count;
}
else {
memcpy (dst, f->data+f->pos, avail);
f->pos += avail;
f->eof = true;
return avail/es;
}
int s = es * count;
int avail = f->size - f->pos;
if (s <= avail) {
memcpy (dst, f->data + f->pos, s);
f->pos += s;
if (f->plistener) {
f->progress_current += s;
if (f->progress_current >= f->progress_next) {
imfile_update_progress(f);
}
}
return count;
} else {
memcpy (dst, f->data + f->pos, avail);
f->pos += avail;
f->eof = true;
return avail / es;
}
}
inline unsigned char* fdata(int offset, IMFILE* f) {
return (unsigned char*)f->data + offset;
inline unsigned char* fdata(int offset, IMFILE* f)
{
return (unsigned char*)f->data + offset;
}
int fscanf (IMFILE* f, const char* s ...);