Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[cleanup] silence multiple compiler warnings #740

Closed
wants to merge 1 commit into from

1 participant

@Chilledheart
  • low priority
  • silence the warning of uninitialized head_id in putcommit-v2-proc.c
  • silence the warning of implicit declaration of g_open in test-seafile-fmt.c
  • silence the warning of implicit declaration of g_stat in test-cdc.c
  • silence the warning of uninitialized e in merge-recursive.c
@Chilledheart Chilledheart [cleanup] silence multiple compiler warnings
  - silence the warning of uninitialized head_id in putcommit-v2-proc.c
  - silence the warning of implicit declaration of g_open in test-seafile-fmt.c
  - silence the warning of implicit declaration of g_stat in test-cdc.c
  - silence the warning of uninitialized e in merge-recursive.c
  - silence the warning of bm->size >= 0 is always true in fileserver.c
001ac1c
@Chilledheart Chilledheart deleted the Chilledheart:cleancode_1 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 18, 2014
  1. @Chilledheart

    [cleanup] silence multiple compiler warnings

    Chilledheart authored
      - silence the warning of uninitialized head_id in putcommit-v2-proc.c
      - silence the warning of implicit declaration of g_open in test-seafile-fmt.c
      - silence the warning of implicit declaration of g_stat in test-cdc.c
      - silence the warning of uninitialized e in merge-recursive.c
      - silence the warning of bm->size >= 0 is always true in fileserver.c
This page is out of date. Refresh to see the latest.
View
7 daemon/merge-recursive.c
@@ -237,9 +237,14 @@ static GList *get_unmerged(struct index_state *index)
if (!ce_in_unmerged_list(unmerged, ce)) {
e = (struct stage_data *)calloc(1, sizeof(struct stage_data));
+ /* TODO: if calloc faild, low memory case */
+ if (e == NULL) {
+ continue;
+ }
e->path = g_strdup(ce->name);
unmerged = g_list_prepend(unmerged, e);
- }
+ } else
+ continue;
e->stages[ce_stage(ce)].ctime = ce->ce_ctime.sec;
e->stages[ce_stage(ce)].mtime = ce->ce_mtime.sec;
View
2  fileserver/access-file.c
@@ -893,7 +893,7 @@ do_block(evhtp_request_t *req, SeafRepo *repo, const char *file_id,
repo->store_id,
repo->version,
blk_id);
- if (bm && bm->size >= 0) {
+ if (bm) {
bsize = bm->size;
found = TRUE;
}
View
4 server/processors/putcommit-v2-proc.c
@@ -317,7 +317,7 @@ collect_commit_id_done (void *vprocessor)
static int
put_commit_start (CcnetProcessor *processor, int argc, char **argv)
{
- char *head_id, *remote_id = NULL;
+ char *head_id = NULL, *remote_id = NULL;
char *session_token;
USE_PRIV;
@@ -330,7 +330,7 @@ put_commit_start (CcnetProcessor *processor, int argc, char **argv)
if (argc == 2) {
head_id = argv[0];
session_token = argv[1];
- } else if (argc >= 3) {
+ } else {
head_id = argv[0];
remote_id = argv[1];
session_token = argv[2];
View
1  tests/test-seafile-fmt.c
@@ -10,6 +10,7 @@
#include <openssl/sha.h>
#include "utils.h"
+#include <glib/gstdio.h>
/* SHA1 calculate */
void
Something went wrong with that request. Please try again.