summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brewer <ben.brewer@codethink.co.uk>2014-05-29 11:48:58 +0100
committerBen Brewer <ben.brewer@codethink.co.uk>2014-05-29 17:43:55 +0100
commit381da8da4ad528672df8f8c4d76629acc0a6855c (patch)
tree97dfb7233b316a0f32b1f5626235337718935b70
parentb619a3979da573fccbdd629be53a7527fcbbdc52 (diff)
downloadtbdiff-381da8da4ad528672df8f8c4d76629acc0a6855c.tar.gz
style: Convert all cpp style comments to c style comments
-rw-r--r--tbdiff/tbdiff-apply.c20
-rw-r--r--tbdiff/tbdiff-create.c16
-rw-r--r--tbdiff/tbdiff-io.c4
-rw-r--r--tbdiff/tbdiff-stat.h4
4 files changed, 22 insertions, 22 deletions
diff --git a/tbdiff/tbdiff-apply.c b/tbdiff/tbdiff-apply.c
index 50b94d0..2eb7565 100644
--- a/tbdiff/tbdiff-apply.c
+++ b/tbdiff/tbdiff-apply.c
@@ -143,9 +143,9 @@ tbd_apply_cmd_dir_create(FILE *stream)
if(mkdir(dname, (mode_t)mode) != 0)
return TBD_ERROR(TBD_ERROR_UNABLE_TO_CREATE_DIR);
- // Apply metadata.
+ /* Apply metadata. */
struct utimbuf timebuff = { time(NULL), mtime };
- utime(dname, &timebuff); // Don't care if it succeeds right now.
+ utime(dname, &timebuff); /* Don't care if it succeeds right now. */
chown(dname, (uid_t)uid, (gid_t)gid);
chmod (dname, mode);
@@ -263,10 +263,10 @@ tbd_apply_cmd_file_create(FILE *stream)
}
fclose(fp);
- // Apply metadata.
+ /* Apply metadata. */
struct utimbuf timebuff = { time(NULL), mtime };
- // Don't care if it succeeds right now.
+ /* Don't care if it succeeds right now. */
utime(fname, &timebuff);
/* Chown ALWAYS have to be done before chmod */
chown(fname, (uid_t)uid, (gid_t)gid);
@@ -380,7 +380,7 @@ tbd_apply_cmd_file_delta(FILE *stream)
fclose(np);
fclose(op);
- // Apply metadata.
+ /* Apply metadata. */
/* file was removed so old permissions were lost
* all permissions need to be reapplied, all were sent in this protocol
* if only changed sent will have to save mdata from file before it is
@@ -529,7 +529,7 @@ tbd_apply_cmd_symlink_create(FILE *stream)
tv[1].tv_sec = (long) mtime;
tv[1].tv_usec = 0;
- lutimes(linkname, tv); // Don't care if it succeeds right now.
+ lutimes(linkname, tv); /* Don't care if it succeeds right now. */
lchown(linkname, (uid_t)uid, (uid_t)gid);
return TBD_ERROR_SUCCESS;
@@ -563,7 +563,7 @@ tbd_apply_cmd_special_create(FILE *stream)
}
struct utimbuf timebuff = { time(NULL), mtime };
- utime(name, &timebuff); // Don't care if it succeeds right now.
+ utime(name, &timebuff); /* Don't care if it succeeds right now. */
chown(name, (uid_t)uid, (gid_t)gid);
chmod(name, mode);
@@ -596,7 +596,7 @@ tbd_apply_cmd_dir_delta(FILE *stream)
if(metadata_mask & TBD_METADATA_MTIME) {
struct utimbuf timebuff = { time(NULL), mtime };
- utime(dname, &timebuff); // Don't care if it succeeds right now.
+ utime(dname, &timebuff); /* Don't care if it succeeds right now. */
}
if(metadata_mask & TBD_METADATA_UID || metadata_mask & TBD_METADATA_GID)
chown(dname, (uid_t)uid, (gid_t)gid);
@@ -631,7 +631,7 @@ tbd_apply_cmd_file_mdata_update(FILE *stream)
if(metadata_mask & TBD_METADATA_MTIME) {
struct utimbuf timebuff = { time(NULL), mtime };
- utime(dname, &timebuff); // Don't care if it succeeds right now.
+ utime(dname, &timebuff); /* Don't care if it succeeds right now. */
}
if(metadata_mask & TBD_METADATA_UID || metadata_mask & TBD_METADATA_GID)
chown(dname, (uid_t)uid, (gid_t)gid);
@@ -755,7 +755,7 @@ tbd_apply(FILE *stream)
break;
case TBD_CMD_ENTITY_MOVE:
case TBD_CMD_ENTITY_COPY:
- return TBD_ERROR(TBD_ERROR_FEATURE_NOT_IMPLEMENTED); // TODO - Implement.
+ return TBD_ERROR(TBD_ERROR_FEATURE_NOT_IMPLEMENTED); /* TODO - Implement. */
case TBD_CMD_ENTITY_DELETE:
if((err = tbd_apply_cmd_entity_delete(stream)) != 0)
return err;
diff --git a/tbdiff/tbdiff-create.c b/tbdiff/tbdiff-create.c
index ec5a8ce..33881ed 100644
--- a/tbdiff/tbdiff-create.c
+++ b/tbdiff/tbdiff-create.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2012 Codethink Ltd.
+ * Copyright (C) 2011-2014 Codethink Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
@@ -303,7 +303,7 @@ tbd_create_cmd_file_delta(FILE *stream,
return TBD_ERROR(TBD_ERROR_UNABLE_TO_OPEN_FILE_FOR_READING);
}
- // Calculate start.
+ /* Calculate start. */
uintptr_t blks[2] = { 256, 256 };
uint8_t buff[2][256];
@@ -332,7 +332,7 @@ tbd_create_cmd_file_delta(FILE *stream,
return TBD_ERROR(TBD_ERROR_UNABLE_TO_SEEK_THROUGH_STREAM);
}
- // Find length.
+ /* Find length. */
long flena = ftell(fpa);
long flenb = ftell(fpb);
@@ -342,7 +342,7 @@ tbd_create_cmd_file_delta(FILE *stream,
return TBD_ERROR(TBD_ERROR_UNABLE_TO_DETECT_STREAM_POSITION);
}
- // Find end.
+ /* Find end. */
blks[0] = 256;
blks[1] = 256;
for(o = 0; true; o += blks[1]) {
@@ -377,7 +377,7 @@ tbd_create_cmd_file_delta(FILE *stream,
}
fclose(fpa);
- // Ensure that the start and end don't overlap for the new file.
+ /* Ensure that the start and end don't overlap for the new file. */
if((flenb - o) < start)
o = (flenb - start);
@@ -385,7 +385,7 @@ tbd_create_cmd_file_delta(FILE *stream,
if(end < start)
end = start;
- uint32_t size = flenb - ((flena - end) + start); //(flenb - (o + start));
+ uint32_t size = flenb - ((flena - end) + start); /* (flenb - (o + start)); */
/* Data is identical, only alter metadata */
if((end == start) && (size == 0)) {
@@ -740,7 +740,7 @@ tbd_create_impl(FILE *stream,
if(!top && ((err = tbd_create_cmd_dir_enter(stream, b->name)) != 0))
return err;
- // Handle changes/additions.
+ /* Handle changes/additions. */
uintptr_t i;
for(i = 0; i < b->size; i++) {
tbd_stat_t *_b = tbd_stat_entry(b, i);
@@ -754,7 +754,7 @@ tbd_create_impl(FILE *stream,
return err;
}
- // Handle deletions.
+ /* Handle deletions. */
for(i = 0; i < a->size; i++) {
err = 0;
diff --git a/tbdiff/tbdiff-io.c b/tbdiff/tbdiff-io.c
index 698273b..14249bd 100644
--- a/tbdiff/tbdiff-io.c
+++ b/tbdiff/tbdiff-io.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2012 Codethink Ltd.
+ * Copyright (C) 2011-2014 Codethink Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
@@ -22,7 +22,7 @@
#include <tbdiff/tbdiff-stat.h>
#if __BYTE_ORDER == __BIG_ENDIAN
-//inverts the indices of an array of bytes.
+/*inverts the indices of an array of bytes. */
static void byteswap (char* value, int size) {
char tmp;
int i;
diff --git a/tbdiff/tbdiff-stat.h b/tbdiff/tbdiff-stat.h
index d23cc80..2908ee9 100644
--- a/tbdiff/tbdiff-stat.h
+++ b/tbdiff/tbdiff-stat.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2012 Codethink Ltd.
+ * Copyright (C) 2011-2014 Codethink Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
@@ -42,7 +42,7 @@ typedef struct {
char* name;
tbd_stat_type_e type;
time_t mtime;
- uint32_t size; // Count for directory.
+ uint32_t size; /* Count for directory. */
uid_t uid;
gid_t gid;
mode_t mode;