Skip to content

Commit

Permalink
Merge branch '1.0' of https://github.com/datastax/cpp-driver into 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenick committed Jun 10, 2014
2 parents a4e028d + b7ca36b commit 2ec3a02
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 129 deletions.
7 changes: 1 addition & 6 deletions examples/async/async.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>

#include "cassandra.h"

#ifdef WIN32
#define snprintf _snprintf
#endif

#define NUM_CONCURRENT_REQUESTS 4096

void print_error(CassFuture* future) {
Expand Down Expand Up @@ -93,7 +88,7 @@ void insert_into_async(CassSession* session, const char* key) {
char key_buffer[64];
statement = cass_statement_new(query, 6, CASS_CONSISTENCY_ONE);

snprintf(key_buffer, sizeof(key_buffer), "%s%zu", key, i);
sprintf(key_buffer, "%s%u", key, (unsigned int)i);
cass_statement_bind_string(statement, 0, cass_string_init(key_buffer));
cass_statement_bind_bool(statement, 1, i % 2 == 0 ? cass_true : cass_false);
cass_statement_bind_float(statement, 2, i / 2.0f);
Expand Down
1 change: 0 additions & 1 deletion examples/basic/basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>

#include "cassandra.h"

Expand Down
1 change: 0 additions & 1 deletion examples/batch/batch.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>

#include "cassandra.h"

Expand Down
1 change: 0 additions & 1 deletion examples/collections/collections.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>

#include "cassandra.h"

Expand Down
1 change: 0 additions & 1 deletion examples/prepared/prepared.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>

#include "cassandra.h"

Expand Down
1 change: 0 additions & 1 deletion examples/uuids/uuids.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>

#include "cassandra.h"

Expand Down
39 changes: 30 additions & 9 deletions include/cassandra.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

#if !defined(CASS_STATIC)
# if (defined(WIN32) || defined(_WIN32))
# if defined CASS_BUILDING
# if defined(CASS_BUILDING)
# define CASS_EXPORT __declspec(dllexport)
# else
# define CASS_EXPORT __declspec(dllexport)
# endif
# elif (defined __SUNPRO_C || defined __SUNPRO_CC) && !defined(CASS_STATIC)
# elif (defined(__SUNPRO_C) || defined(__SUNPRO_CC)) && !defined(CASS_STATIC)
# define CASS_EXPORT __global
# elif (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER
# elif (defined(__GNUC__) && __GNUC__ >= 4) || defined(__INTEL_COMPILER)
# define CASS_EXPORT __attribute__ ((visibility("default")))
# endif
#else
Expand All @@ -41,19 +41,40 @@ extern "C" {
#endif

typedef enum { cass_false = 0, cass_true = 1 } cass_bool_t;

typedef float cass_float_t;
typedef double cass_double_t;
typedef unsigned char cass_byte_t;
typedef unsigned int cass_duration_t;

typedef size_t cass_size_t;

#if defined(__GNUC__) || defined(__INTEL_COMPILER)
typedef __INT8_TYPE__ cass_int8_t;
typedef __UINT8_TYPE__ cass_uint8_t;

typedef __INT16_TYPE__ cass_int16_t;
typedef __UINT16_TYPE__ cass_uint16_t;

typedef __INT32_TYPE__ cass_int32_t;
typedef __UINT32_TYPE__ cass_uint32_t;

typedef __INT64_TYPE__ cass_int64_t;
typedef __UINT64_TYPE__ cass_uint64_t;
#else
typedef char cass_int8_t;
typedef short cass_int16_t;
typedef int cass_int32_t;
typedef long long cass_int64_t;
typedef unsigned char cass_uint8_t;

typedef short cass_int16_t;
typedef unsigned short cass_uint16_t;

typedef int cass_int32_t;
typedef unsigned int cass_uint32_t;

typedef long long cass_int64_t;
typedef unsigned long long cass_uint64_t;
typedef size_t cass_size_t;
#endif

typedef cass_uint8_t cass_byte_t;
typedef cass_uint64_t cass_duration_t;

typedef struct CassBytes_ {
const cass_byte_t* data;
Expand Down
41 changes: 0 additions & 41 deletions instruction_win_lin.txt.txt

This file was deleted.

59 changes: 0 additions & 59 deletions macosx_instruction.txt

This file was deleted.

8 changes: 0 additions & 8 deletions src/address.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,6 @@ class Address {
return addr()->sa_family;
}

socklen_t length() const {
#ifdef WIN32
addr()->sa_family == AF_INET ? sizeof(sockaddr_in) : sizeof(sockaddr_in6);
#else
return addr()->sa_len;
#endif
}

int port() const {
if(addr()->sa_family == AF_INET) {
return htons(addr_in()->sin_port);
Expand Down
2 changes: 2 additions & 0 deletions src/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#ifndef __CASS_LOGGER_HPP_INCLUDED__
#define __CASS_LOGGER_HPP_INCLUDED__

#include <stdarg.h>

#include <string>

#include "event_thread.hpp"
Expand Down
4 changes: 3 additions & 1 deletion test/ccm_bridge/src/cql_escape_sequences_remover.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <string.h>

#include <cctype>
#include <string>
#include "cql_escape_sequences_remover.hpp"
Expand Down Expand Up @@ -114,4 +116,4 @@ namespace cql {
void cql_escape_sequences_remover_t::clear_buffer() {
_buffer.clear();
}
}
}

0 comments on commit 2ec3a02

Please sign in to comment.