#include "../Interface/Thread.h"
#include "../Interface/Mutex.h"

class ClientMain;
struct SProcess;

class ServerPingThread : public IThread
{
public:
	ServerPingThread(ClientMain *client_main, const std::string& clientname,
		size_t status_id, bool with_eta, std::string server_token);
	void operator()(void);
	void setStop(bool b);

	bool isTimeout(void);

private:
	void setPaused(SProcess* proc, bool b);
	ClientMain *client_main;
	volatile bool stop;
	volatile bool is_timeout;
	bool with_eta;
	const std::string& clientname;
	size_t status_id;
	std::string server_token;
};

#include "../Interface/Thread.h"
#include "../Interface/Mutex.h"

class ClientMain;
struct SProcess;

class ServerPingThread : public IThread
{
public:
	ServerPingThread(ClientMain *client_main, const std::string& clientname,
		size_t status_id, bool with_eta, std::string server_token);
	void operator()(void);
	void setStop(bool b);

	bool isTimeout(void);

private:
	void setPaused(SProcess* proc, bool b);
	ClientMain *client_main;
	volatile bool stop;
	volatile bool is_timeout;
	bool with_eta;
	std::string clientname;
	size_t status_id;
	std::string server_token;
};

Copy clientname instead of reference

Copy clientname instead of reference


#ifndef CALC_SCANNER_DEF_H_
#define CALC_SCANNER_DEF_H_

typedef union {
    int int_value;
} YYSTYPE;

typedef struct {
	int function;
    int result;
	YYSTYPE lhs;
	YYSTYPE rhs;
} BinaryFunction;

class ParserState {
public:
    int result;
	int eval;
    ParserState() : result(0) {
    }
};

#endif // CALC_SCANNER_DEF_H_

#ifndef CALC_SCANNER_DEF_H_
#define CALC_SCANNER_DEF_H_

typedef union {
    int int_value;
} YYSTYPE;

class ParserState {
public:
    int result;
	int eval;
    ParserState() : result(0) {
    }
};

#endif // CALC_SCANNER_DEF_H_

Remove silly struct that's silly

Remove silly struct that's silly


//===-- Transform/Utils/FunctionUtils.h - Function Utils --------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This family of functions perform manipulations on functions.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_TRANSFORMS_UTILS_FUNCTION_H
#define LLVM_TRANSFORMS_UTILS_FUNCTION_H

namespace llvm {

class Function;
class Loop;

/// ExtractLoop - rip out a natural loop into a new function
///
Function* ExtractLoop(Loop *L);

}

#endif

//===-- Transform/Utils/FunctionUtils.h - Function Utils --------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This family of functions perform manipulations on functions.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_TRANSFORMS_UTILS_FUNCTION_H
#define LLVM_TRANSFORMS_UTILS_FUNCTION_H

namespace llvm {

class Function;
class Loop;

/// ExtractLoop - rip out a natural loop into a new function
///
Function* ExtractLoop(Loop *L);

/// ExtractBasicBlock - rip out a basic block into a new function
///
Function* ExtractBasicBlock(BasicBlock *BB);

}

#endif

Add ability to extract a single basic block into a new function.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@12052 91177308-0d34-0410-b5e6-96231b3b80d8


#ifndef _IOTSAFS_H_
#define _IOTSAFS_H_
//
// SPIFFS/LittleFS choice is complex, also for include file differences on ESP32/ESP8266.
// So put if all in a separate include file.
//
#include <FS.h>

#ifdef IOTSA_WITH_LEGACY_SPIFFS
#ifdef ESP32
#include <SPIFFS.h>
#endif
#define IOTSA_FS SPIFFS
#define IOTSA_FS_NAME "SPIFFS"
#else
#include <LittleFS.h>
#define IOTSA_FS LittleFS
#define IOTSA_FS_NAME "LittleFS"
#endif

#endif

#ifndef _IOTSAFS_H_
#define _IOTSAFS_H_
//
// SPIFFS/LittleFS choice is complex, also for include file differences on ESP32/ESP8266.
// So put if all in a separate include file.
//
#include <FS.h>

#ifdef IOTSA_WITH_LEGACY_SPIFFS
#ifdef ESP32
#include <SPIFFS.h>
#endif
#define IOTSA_FS SPIFFS
#define IOTSA_FS_NAME "SPIFFS"
#else
#ifdef ESP32
#include <LITTLEFS.h>
#define IOTSA_FS LITTLEFS
#else
#include <LittleFS.h>
#define IOTSA_FS LittleFS
#endif
#define IOTSA_FS_NAME "LittleFS"
#endif

#endif

Undo change for LittleFS include name: Arduino uses the capitalized one.


/* rwsem-const.h: RW semaphore counter constants.  */
#ifndef _SPARC64_RWSEM_CONST_H
#define _SPARC64_RWSEM_CONST_H

#define RWSEM_UNLOCKED_VALUE		0x00000000
#define RWSEM_ACTIVE_BIAS		0x00000001
#define RWSEM_ACTIVE_MASK		0x0000ffff
#define RWSEM_WAITING_BIAS		0xffff0000
#define RWSEM_ACTIVE_READ_BIAS		RWSEM_ACTIVE_BIAS
#define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)

#endif /* _SPARC64_RWSEM_CONST_H */

/* rwsem-const.h: RW semaphore counter constants.  */
#ifndef _SPARC64_RWSEM_CONST_H
#define _SPARC64_RWSEM_CONST_H

#define RWSEM_UNLOCKED_VALUE		0x00000000
#define RWSEM_ACTIVE_BIAS		0x00000001
#define RWSEM_ACTIVE_MASK		0x0000ffff
#define RWSEM_WAITING_BIAS		(-0x00010000)
#define RWSEM_ACTIVE_READ_BIAS		RWSEM_ACTIVE_BIAS
#define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)

#endif /* _SPARC64_RWSEM_CONST_H */

sparc64: Fix rwsem constant bug leading to hangs.

As noticed by Linus, it is critical that some of the
rwsem constants be signed.  Yet, hex constants are
unsigned unless explicitly casted or negated.

The most critical one is RWSEM_WAITING_BIAS.

This bug was exacerbated by commit
424acaaeb3a3932d64a9b4bd59df6cf72c22d8f3 ("rwsem: wake queued readers
when writer blocks on active read lock")

Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>


//===- CodeGenRegisters.h - Register and RegisterClass Info -----*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines structures to encapsulate information gleaned from the
// target register and register class definitions.
//
//===----------------------------------------------------------------------===//

#ifndef CODEGEN_REGISTERS_H
#define CODEGEN_REGISTERS_H

#include <string>

namespace llvm {
  class Record;

  /// CodeGenRegister - Represents a register definition.
  struct CodeGenRegister {
    Record *TheDef;
    const std::string &getName() const;

    CodeGenRegister(Record *R) : TheDef(R) {}
  };

  struct CodeGenRegisterClass {

  };
}

#endif

Add initial support for register and register class representation.
Obviously this is not done.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@15804 91177308-0d34-0410-b5e6-96231b3b80d8


// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
#define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_

#include "ppapi/c/pp_var.h"

#define PPB_PRIVATE_INTERFACE "PPB_Private;1"

typedef enum _ppb_ResourceString {
  PPB_RESOURCE_STRING_PDF_GET_PASSWORD = 0,
} PP_ResourceString;

typedef struct _ppb_Private {
  // Returns a localized string.
  PP_Var (*GetLocalizedString)(PP_ResourceString string_id);
} PPB_Private;

#endif  // WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_

// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
#define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_

#include "third_party/ppapi/c/pp_var.h"

#define PPB_PRIVATE_INTERFACE "PPB_Private;1"

typedef enum _ppb_ResourceString {
  PPB_RESOURCE_STRING_PDF_GET_PASSWORD = 0,
} PP_ResourceString;

typedef struct _ppb_Private {
  // Returns a localized string.
  PP_Var (*GetLocalizedString)(PP_ResourceString string_id);
} PPB_Private;

#endif  // WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_

Add third_party/ prefix to ppapi include for checkdeps.

The only users of this ppb should be inside chrome so this should work fine.

TBR=jam@chromium.org

Review URL: http://codereview.chromium.org/3019006

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@52766 0039d316-1c4b-4281-b951-d872f2087c98


// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_
#define SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_
typedef long int greg_t;
typedef unsigned long sigset_t;
typedef struct ucontext {
  unsigned long   uc_flags;
  struct ucontext  *uc_link;
  stack_t     uc_stack;
  struct sigcontext uc_mcontext;
  sigset_t    uc_sigmask;
  /* Allow for uc_sigmask growth.  Glibc uses a 1024-bit sigset_t.  */
  int     __not_used[32 - (sizeof (sigset_t) / sizeof (int))];
  /* Last for extensibility.  Eight byte aligned because some
     coprocessors require eight byte alignment.  */
  unsigned long   uc_regspace[128] __attribute__((__aligned__(8)));
} ucontext_t;
#endif  // SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_
#define SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_

#include <asm/sigcontext.h>

typedef long int greg_t;
typedef unsigned long sigset_t;
typedef struct ucontext {
  unsigned long   uc_flags;
  struct ucontext  *uc_link;
  stack_t     uc_stack;
  struct sigcontext uc_mcontext;
  sigset_t    uc_sigmask;
  /* Allow for uc_sigmask growth.  Glibc uses a 1024-bit sigset_t.  */
  int     __not_used[32 - (sizeof (sigset_t) / sizeof (int))];
  /* Last for extensibility.  Eight byte aligned because some
     coprocessors require eight byte alignment.  */
  unsigned long   uc_regspace[128] __attribute__((__aligned__(8)));
} ucontext_t;
#endif  // SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_

Fix for downstream android webview

Fix for downstream android webview

Previously erros is struct sigcontext is not defined. Including the
header file now.

TBR=jln,markus
Android only include change. Android trybots pass compile.
NOTRY=true
BUG=

Review URL: https://chromiumcodereview.appspot.com/11636039

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@174104 0039d316-1c4b-4281-b951-d872f2087c98


/*
 * Copyright (c) 2021 IoT.bzh
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_RENESAS_RCAR_CPG_MSSR_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_RENESAS_RCAR_CPG_MSSR_H_

#define CPG_CORE                        0       /* Core Clock */
#define CPG_MOD                         1       /* Module Clock */

#define CPG_CORE_CLK_CANFD              0       /* CANFD clock */
#define CPG_CORE_CLK_S3D4               1       /* S3D4 Clock */

#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_RENESAS_RCAR_CPG_MSSR_H_ */

Add Renesas clock control driver

include: Add Renesas clock control driver

DTS bindings file for Renesas RCar CPG clock control.

Signed-off-by: Julien Massot <ad45d338e0f9dc7767e692227f7b2fcd41b31818@iot.bzh>


/* Narcissus
 * © 2015 David Given
 * This file is redistributable under the terms of the two-clause BSD license;
 * see COPYING in the distribution root for the full text.
 */

#ifndef DEVICES_H
#define DEVICES_H

#include <X11/Xlib.h>

struct button
{
	int keycode;
	uint32_t button;
};

struct chord
{
	uint32_t buttons;
	int keysym;
};

struct device
{
	const char* name;
	struct button* buttons;
	struct chord* chords;
};

extern const struct device razer_nostromo;

extern const struct device* find_connected_device(Display* display, int* deviceid);
extern const struct device* find_device_by_name(const char* name);
extern void load_device(const struct device* device);
uint32_t keycode_to_button(int keysym);
int decode_chord(uint32_t buttons);

#define MODIFIER_MASK ((1<<24) - 1)
#define CTRL          (1<<24)
#define ALT           (1<<25)
#define META          (1<<26)

#endif

/* Narcissus
 * © 2015 David Given
 * This file is redistributable under the terms of the two-clause BSD license;
 * see COPYING in the distribution root for the full text.
 */

#ifndef DEVICES_H
#define DEVICES_H

#include <X11/Xlib.h>

struct button
{
	int keycode;
	uint32_t button;
};

struct chord
{
	uint32_t buttons;
	int keysym;
};

struct device
{
	const char* name;
	struct button* buttons;
	struct chord* chords;
};

extern const struct device razer_nostromo;

extern const struct device* find_connected_device(Display* display, int* deviceid);
extern const struct device* find_device_by_name(const char* name);
extern void load_device(const struct device* device);
uint32_t keycode_to_button(int keysym);
int decode_chord(uint32_t buttons);

#define MODIFIER_MASK ((1<<24) - 1)
#define CTRL          (1<<24)
#define ALT           (1<<25)
/* Note: META doesn't work with libfakekey 0.1-8.1 */
#define META          (1<<26)

#endif

Document that meta doesn't work.

Document that meta doesn't work.


/*
 * Copyright (c) 2016, Texas Instruments Incorporated
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef __INC_BOARD_H
#define __INC_BOARD_H

#endif /* __INC_BOARD_H */

/*
 * Copyright (c) 2016, Texas Instruments Incorporated
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef __INC_BOARD_H
#define __INC_BOARD_H

/* Push button switch 2 */
#define SW2_GPIO_PIN	6    /* GPIO22/Pin15 */
#define SW2_GPIO_NAME	"GPIO_A2"

/* Push button switch 3 */
#define SW3_GPIO_PIN	5    /* GPIO13/Pin4 */
#define SW3_GPIO_NAME	"GPIO_A1"

/* Push button switch 0: Map to SW2 so zephyr button example works */
#define SW0_GPIO_PIN	SW2_GPIO_PIN
#define SW0_GPIO_NAME	SW2_GPIO_NAME

/* Onboard GREEN LED */
#define LED0_GPIO_PIN   3  /*GPIO11/Pin2 */
#define LED0_GPIO_PORT  "GPIO_A1"

#endif /* __INC_BOARD_H */

cc3200: Add generic definitions for LEDs and switches

Adds generic definitions for GPIO pins for onboard LEDs and
switches to enable the basic blinky, button, and disco
Zephyr examples for the TI CC3200 LaunchXL.

Change-Id: Iac0ed2ad01285f9e84eea1fa7013771ddd8d3a78
Signed-off-by: Gil Pitney <477da50908f0a7963c2c490cce0ff096d2cac162@linaro.org>


// -*- mode: c++ -*-
#ifndef _GET_DATA_CHUNK_SERVER_SOCKET_H_
#define _GET_DATA_CHUNK_SERVER_SOCKET_H_

#include <boost/shared_ptr.hpp>
#include <boost/asio.hpp>

class Socket
{
  typedef boost::shared_ptr<boost::asio::ip::tcp::socket> SocketImplPtr;

public:
  Socket(SocketImplPtr socket);
  virtual ~Socket();

private:
  SocketImplPtr m_socket;
};

#endif

Add a thread-safe socket class.

Add a thread-safe socket class.


#include <stdio.h>
/* Interface to JPEG code */
#include "jpeglib.h"
#include <setjmp.h>

struct error_mgr2 {
  struct jpeg_error_mgr pub;	/* "public" fields */

  jmp_buf setjmp_buffer;	/* for return to caller */
};

typedef struct error_mgr2* error_ptr2;

void error_exit (j_common_ptr cinfo);
GLOBAL(void) jpeg_mem_src (j_decompress_ptr cinfo, char * pSourceData, unsigned sourceDataSize);
GLOBAL(int) jpeg_mem_src_newLocationOfData (j_decompress_ptr cinfo, char * pSourceData, unsigned sourceDataSize);
GLOBAL(void) jpeg_mem_dest (j_compress_ptr cinfo, char * pDestination, unsigned *pDestinationSize);
void primJPEGWriteImageonByteArrayformqualityprogressiveJPEGerrorMgrWriteScanlines(
    unsigned int,
    unsigned int,
    int,
    unsigned int*,
    char*,
    char*,
    int,
    int,
    unsigned int,
    unsigned int,
    char*,
    unsigned int*);

void primJPEGReadImagefromByteArrayonFormdoDitheringerrorMgrReadScanlines(
    char*,
    char*,
    char*,
    unsigned int,
    int,
    unsigned int*,
    unsigned int,
    unsigned int,
    int);

void primJPEGReadHeaderfromByteArraysizeerrorMgrReadHeader(
    char*,
    char*,
    unsigned int);
    char*);

#include <stdio.h>
/* Interface to JPEG code */
#include "jpeglib.h"
#include <setjmp.h>

struct error_mgr2 {
  struct jpeg_error_mgr pub;	/* "public" fields */

  jmp_buf setjmp_buffer;	/* for return to caller */
};

typedef struct error_mgr2* error_ptr2;

void error_exit (j_common_ptr cinfo);
GLOBAL(void) jpeg_mem_src (j_decompress_ptr cinfo, char * pSourceData, unsigned sourceDataSize);
GLOBAL(int) jpeg_mem_src_newLocationOfData (j_decompress_ptr cinfo, char * pSourceData, unsigned sourceDataSize);
GLOBAL(void) jpeg_mem_dest (j_compress_ptr cinfo, char * pDestination, unsigned *pDestinationSize);
void primJPEGWriteImageonByteArrayformqualityprogressiveJPEGerrorMgrWriteScanlines(
    unsigned int,
    unsigned int,
    int,
    unsigned int*,
    char*,
    char*,
    int,
    int,
    unsigned int,
    unsigned int,
    char*,
    unsigned int*);

void primJPEGReadImagefromByteArrayonFormdoDitheringerrorMgrReadScanlines(
    char*,
    char*,
    char*,
    unsigned int,
    int,
    unsigned int*,
    unsigned int,
    unsigned int,
    int);

void primJPEGReadHeaderfromByteArraysizeerrorMgrReadHeader(
    char*,
    char*,
    unsigned int,
    char*);

Fix typo in method signature

Fix typo in method signature

git-svn-id: http://squeakvm.org/svn/squeak/trunk@3745 fa1542d4-bde8-0310-ad64-8ed1123d492a

Former-commit-id: 76afe8ba507e75296f2fbba2c2c20aaa29c41819


/*
name: TEST028
description: Test of reinterpretation in define
output:
F5
G6	F5	foo
{
\
	r	"6869	'P
}
*/

#define M(x) x
#define A(a,b) a(b)

char *
foo(void)
{
	return A(M,"hi");
}

Add test for nested expansion in macros

Add test for nested expansion in macros


#include <stdio.h>
#include <stdint.h>

#include "rand.h"

static uint64_t sqrt64(uint64_t n) {
	uint64_t g = UINT64_C(1) << 31;

	for (uint64_t c = g; c; g |= c) {
		if (g * g > n) {
			g ^= c;
		}
		c >>= 1;
	}
	return g;
}

static uint64_t get_split(uint64_t len) {
	uint64_t rnd;
	rand_fill(&rnd, sizeof(rnd));
	rnd %= (len * len);
	return sqrt64(rnd) + 1;
}

int main(int __attribute__ ((unused)) argc, char __attribute__ ((unused)) *argv[]) {
	rand_init();

	for (uint64_t len = 1397; len;) {
		uint64_t consume = get_split(len);
		fprintf(stderr, "consume %ju bytes\n", (uintmax_t) consume);
		len -= consume;
	}

	rand_cleanup();
}

#include <stdio.h>
#include <stdint.h>

#include "rand.h"

static uint64_t get_split(uint64_t total_len, uint64_t remaining_len) {
	uint64_t rnd;
	rand_fill(&rnd, sizeof(rnd));
	rnd %= total_len;
	return rnd > remaining_len ? remaining_len : rnd;
}

int main(int __attribute__ ((unused)) argc, char __attribute__ ((unused)) *argv[]) {
	rand_init();

	uint64_t total_len = 1397;
	for (uint64_t remaining = total_len, consume = 0; remaining; remaining -= consume) {
		consume = get_split(total_len, remaining);
		fprintf(stderr, "consume %ju bytes\n", (uintmax_t) consume);
	}

	rand_cleanup();
}

Fix random algo to evenly distribute.

Fix random algo to evenly distribute.


/*
name: TEST019
description: Basic test of constant folding in integer arithmetic operations
output:
test019.c:13: warning: division by 0
test019.c:14: warning: division by 0
F1
G1	F1	main
{
-
A2	I	i
	A2	#I3	:I
	A2	#I1	:I
	A2	#I12	:I
	A2	#I2	:I
	A2	#I0	:I
	A2	A2	#I0	%I	:I
	A2	A2	#I0	%I	:I
	A2	#I8	:I
	A2	#I2	:I
	A2	#I4	:I
	A2	#IC	:I
	A2	#I8	:I
	A2	#IFFFFFFFD	:I
	A2	#IFFFFFFF3	:I
	A2	#I1	:I
	A2	#I0	:I
	A2	#I0	:I
	A2	#I1	:I
	A2	#I0	:I
}
*/

#line 1

int
main(void)
{
	int i;

	i = 1 + 2;
	i = 2 - 1;
	i = 3 * 6;
	i = 10 / 5;
	i = 10 % 5;
	i = i % 0;
	i = i % 0;
	i = 1 << 3;
	i = 8 >> 2;
	i = 12 & 4;
	i = 8 | 4;
	i = 12 ^ 4;
	i = -(3);
	i = ~12;
	i = 1 < 3;
	i = 2 > 3;
	i = 2 >= 3;
	i = 2 <= 3;
	i = 1 == 0;
}

Add basic test for integer constant folding


/*
name: TEST044
description: Test of corner cases in #if
output:
test044.c:14: warning: division by 0
test044.c:18: warning: division by 0
test044.c:22: warning: division by 0
test044.c:28: error: parameter of #if is not an integer constant expression
test044.c:29: error: #error  3 != (1,2,3)
*/

/* These should be accepted */

  #if 0 != (0 && (0/0))
    #error 0 != (0 && (0/0))
  #endif

  #if 1 != (-1 || (0/0))
    #error 1 != (-1 || (0/0))
  #endif

  #if 3 != (-1 ? 3 : (0/0))
    #error 3 != (-1 ? 3 : (0/0))
  #endif

/* This is invalid code (it is a constraint violation) */

  #if 3 != (1,2,3)
    #error 3 != (1,2,3)
  #endif

Add test for preprocessor corner cases

Add test for preprocessor corner cases


/**
 * @file
 * @brief Internal implementation of static slab allocator
 *
 * @date 07.03.2011
 * @author Kirill Tyushev
 */

#ifndef SLAB_STATIC_H_
# error "Do not include this file directly, use <kernel/mm/slab_static.h> instead!"
#endif /* SLAB_STATIC_H_ */

#include <util/binalign.h>

/** cache descriptor */
struct static_cache {
	/** pointer to pool */
	char* cache_begin;
	/** object size */
	size_t size;
	/** the number of objects stored on each slab */
	unsigned int num;
	/** the list of free objects in pool */
	struct list_head obj_ptr;
	/** for initialization */
	int hasinit;
};

/** create cache */
#define __STATIC_CACHE_CREATE(name, type, count) \
  static char __name_pool[count * binalign_bound(sizeof(type), sizeof(struct list_head))]; \
  static static_cache_t name = { \
        .num = count, \
        .size = binalign_bound(sizeof(type), sizeof(struct list_head)), \
        .cache_begin = __name_pool, \
        .obj_ptr = {NULL, NULL}, \
        .hasinit = 0 }

/**
 * @file
 * @brief Internal implementation of static slab allocator
 *
 * @date 07.03.2011
 * @author Kirill Tyushev
 */

#ifndef SLAB_STATIC_H_
# error "Do not include this file directly, use <kernel/mm/slab_static.h> instead!"
#endif /* SLAB_STATIC_H_ */

#include <util/binalign.h>

/** cache descriptor */
struct static_cache {
	/** pointer to pool */
	char* cache_begin;
	/** object size */
	size_t size;
	/** the number of objects stored on each slab */
	unsigned int num;
	/** the list of free objects in pool */
	struct list_head obj_ptr;
	/** for initialization */
	int hasinit;
};

/** create cache */
#define __STATIC_CACHE_CREATE(name, type, count) \
  static char name ## _pool[count * binalign_bound(sizeof(type), sizeof(struct list_head))]; \
  static static_cache_t name = { \
        .num = count, \
        .size = binalign_bound(sizeof(type), sizeof(struct list_head)), \
        .cache_begin = name ## _pool, \
        .obj_ptr = {NULL, NULL}, \
        .hasinit = 0 }

Fix macro replacement: removal of conflict with __name_pool

(using pasting)


#ifndef _ECORE_STR_H
# define _ECORE_STR_H

#ifdef EAPI
#undef EAPI
#endif
#ifdef WIN32
# ifdef BUILDING_DLL
#  define EAPI __declspec(dllexport)
# else
#  define EAPI __declspec(dllimport)
# endif
#else
# ifdef __GNUC__
#  if __GNUC__ >= 4
#   define EAPI __attribute__ ((visibility("default")))
#  else
#   define EAPI
#  endif
# else
#  define EAPI
# endif
#endif

/**
 * @file Ecore_Data.h
 * @brief Contains threading, list, hash, debugging and tree functions.
 */

# ifdef __cplusplus
extern "C" {
# endif

# ifdef __sgi
#  define __FUNCTION__ "unknown"
#  ifndef __cplusplus
#   define inline
#  endif
# endif

   /* strlcpy implementation for libc's lacking it */
   EAPI size_t ecore_strlcpy(char *dst, const char *src, size_t siz);

#ifdef __cplusplus
}
#endif
#endif				/* _ECORE_STR_H */

#ifndef _ECORE_STR_H
# define _ECORE_STR_H

#ifdef EAPI
#undef EAPI
#endif
#ifdef WIN32
# ifdef BUILDING_DLL
#  define EAPI __declspec(dllexport)
# else
#  define EAPI __declspec(dllimport)
# endif
#else
# ifdef __GNUC__
#  if __GNUC__ >= 4
#   define EAPI __attribute__ ((visibility("default")))
#  else
#   define EAPI
#  endif
# else
#  define EAPI
# endif
#endif

/**
 * @file Ecore_Str.h
 * @brief Contains useful C string functions.
 */

# ifdef __cplusplus
extern "C" {
# endif

# ifdef __sgi
#  define __FUNCTION__ "unknown"
#  ifndef __cplusplus
#   define inline
#  endif
# endif

   /* strlcpy implementation for libc's lacking it */
   EAPI size_t ecore_strlcpy(char *dst, const char *src, size_t siz);

#ifdef __cplusplus
}
#endif
#endif				/* _ECORE_STR_H */

Fix doxygen comments for new header.

Fix doxygen comments for new header.

SVN revision: 27891


#include <stdlib.h>
#include <string.h>
#include "chip8.h"

chip8_t * chip8_new(void) {
  int i;
  chip8_t * self = (chip8_t *) malloc(sizeof(chip8_t));

  // The first 512 bytes are used by the interpreter.
  self->program_counter = 0x200;
  self->index_register  = 0;
  self->stack_pointer   = 0;
  self->opcode          = 0;

  memcpy(self->memory, chip8_hex_font, 50);

  return self;
}

void chip8_free(chip8_t * self) {
  free(self);
}

#include <stdlib.h>
#include <string.h>
#include "chip8.h"

chip8_t * chip8_new(void) {
  chip8_t * self = (chip8_t *) malloc(sizeof(chip8_t));

  // The first 512 bytes are used by the interpreter.
  self->program_counter = 0x200;
  self->index_register  = 0;
  self->stack_pointer   = 0;
  self->opcode          = 0;

  memcpy(self->memory, chip8_hex_font, 50);

  return self;
}

void chip8_free(chip8_t * self) {
  free(self);
}

Remove unused variable (int i)

Remove unused variable (int i)


#include <math.h>
#include "gauge.h"

/**
 * Initializes the gauge struct
 * @arg gauge The gauge struct to initialize
 * @return 0 on success.
 */
int init_gauge(gauge_t *gauge) {
    gauge->count = 0;
    gauge->sum = 0;
    gauge->value = 0;
    return 0;
}

/**
 * Adds a new sample to the struct
 * @arg gauge The gauge to add to
 * @arg sample The new sample value
 * @arg delta   Is this a delta update?
 * @return 0 on success.
 */
int gauge_add_sample(gauge_t *gauge, double sample, bool delta) {
    if (delta) {
        gauge->value += sample;
    } else {
        gauge->value = sample;
    }
    gauge->sum += sample;
    gauge->count++;
    return 0;
}

/**
 * Returns the number of samples in the gauge
 * @arg gauge The gauge to query
 * @return The number of samples
 */
uint64_t gauge_count(gauge_t *gauge) {
    return gauge->count;
}

/**
 * Returns the mean gauge value
 * @arg gauge The gauge to query
 * @return The mean value of the gauge
 */
double gauge_mean(gauge_t *gauge) {
    return (gauge->count) ? gauge->sum / gauge->count : 0;
}

/**
 * Returns the sum of the gauge
 * @arg gauge The gauge to query
 * @return The sum of values
 */
double gauge_sum(gauge_t *gauge) {
    return gauge->sum;
}

/**
 * Returns the gauge value (for backwards compat)
 * @arg gauge  the gauge to query
 * @return The gauge value
 */
double gauge_value(gauge_t *gauge) {
    return gauge->value;
}

#include <math.h>
#include "gauge.h"

int init_gauge(gauge_t *gauge) {
    gauge->count = 0;
    gauge->sum = 0;
    gauge->value = 0;
    return 0;
}

int gauge_add_sample(gauge_t *gauge, double sample, bool delta) {
    if (delta) {
        gauge->value += sample;
    } else {
        gauge->value = sample;
    }
    gauge->sum += sample;
    gauge->count++;
    return 0;
}

uint64_t gauge_count(gauge_t *gauge) {
    return gauge->count;
}

double gauge_mean(gauge_t *gauge) {
    return (gauge->count) ? gauge->sum / gauge->count : 0;
}

double gauge_sum(gauge_t *gauge) {
    return gauge->sum;
}

double gauge_value(gauge_t *gauge) {
    return gauge->value;
}

Remove duplicate comment from the c file


//
//
// Copyright (C) 2010 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// Copyright (C) 2010 SIPez LLC All rights reserved.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// $$
// Author: Daniel Petrie
//         dpetrie AT SIPez DOT com
//////////////////////////////////////////////////////////////////////////////

#ifndef _sipxunittests_h_
#define _sipxunittests_h_

#if !defined(NO_CPPUNIT) && defined(ANDROID)
#define NO_CPPUNIT 1
#endif

#if defined(NO_CPPUNIT)

#define SIPX_UNIT_BASE_CLASS SipxPortUnitTestClass

#include <os/OsIntTypes.h>
#include <sipxportunit/SipxPortUnitTest.h>
#include <utl/UtlString.h>

typedef UtlString string;

#else

#define SIPX_UNIT_BASE_CLASS CppUnit::TestCase

#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestCase.h>

using namespace std;

#endif

#endif

//
//
// Copyright (C) 2010-2016 SIPez LLC. All rights reserved.
//
// $$
// Author: Daniel Petrie
//         dpetrie AT SIPez DOT com
//////////////////////////////////////////////////////////////////////////////

#ifndef _sipxunittests_h_
#define _sipxunittests_h_

//#if !defined(NO_CPPUNIT) && defined(ANDROID)
#define NO_CPPUNIT 1
//#endif

#if defined(NO_CPPUNIT)

#define SIPX_UNIT_BASE_CLASS SipxPortUnitTestClass

#include <os/OsIntTypes.h>
#include <sipxportunit/SipxPortUnitTest.h>
#include <utl/UtlString.h>

typedef UtlString string;

#else

#define SIPX_UNIT_BASE_CLASS CppUnit::TestCase

#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestCase.h>

using namespace std;

#endif

#endif

Make portable unit tests default on all platforms.
(vs CPPUNIT)

git-svn-id: 8a77b5e12cf30fc5f8c95b12d648985d6db39537@12346 a612230a-c5fa-0310-af8b-88eea846685b


/*
 * getarguments.c -- Get the argument vector ready to go.
 *
 * This code is Copyright (c) 2002, by the authors of nmh.  See the
 * COPYRIGHT file in the root directory of the nmh distribution for
 * complete copyright information.
 */

#include <h/mh.h>
#include <h/utils.h>

char **
getarguments (char *invo_name, int argc, char **argv, int check_context)
{
    char *cp = NULL, **ap = NULL, **bp = NULL, **arguments = NULL;
    int n = 0;

    /*
     * Check if profile/context specifies any arguments
     */
    if (check_context && (cp = context_find (invo_name))) {
	cp = getcpy (cp);		/* make copy    */
	ap = brkstring (cp, " ", "\n");	/* split string */

	/* Count number of arguments split */
	bp = ap;
	while (*bp++)
	    n++;
    }

    arguments = (char **) mh_xmalloc ((argc + n) * sizeof(*arguments));
    bp = arguments;

    /* Copy any arguments from profile/context */
    if (ap != NULL && n > 0) {
	while (*ap)
	    *bp++ = *ap++;
     }

    /* Copy arguments from command line */
    argv++;
    while (*argv)
	*bp++ = *argv++;

    /* Now NULL terminate the array */
    *bp = NULL;

    return arguments;
}

/*
 * getarguments.c -- Get the argument vector ready to go.
 *
 * This code is Copyright (c) 2002, by the authors of nmh.  See the
 * COPYRIGHT file in the root directory of the nmh distribution for
 * complete copyright information.
 */

#include <h/mh.h>
#include <h/utils.h>

char **
getarguments (char *invo_name, int argc, char **argv, int check_context)
{
    char *cp = NULL, **ap = NULL, **bp = NULL, **arguments = NULL;
    int n = 0;

    /*
     * Check if profile/context specifies any arguments
     */
    if (check_context && (cp = context_find (invo_name))) {
	cp = mh_xstrdup(cp);		/* make copy    */
	ap = brkstring (cp, " ", "\n");	/* split string */

	/* Count number of arguments split */
	bp = ap;
	while (*bp++)
	    n++;
    }

    arguments = (char **) mh_xmalloc ((argc + n) * sizeof(*arguments));
    bp = arguments;

    /* Copy any arguments from profile/context */
    if (ap != NULL && n > 0) {
	while (*ap)
	    *bp++ = *ap++;
     }

    /* Copy arguments from command line */
    argv++;
    while (*argv)
	*bp++ = *argv++;

    /* Now NULL terminate the array */
    *bp = NULL;

    return arguments;
}

Replace getcpy() with mh_xstrdup() where the string isn't NULL.


/*

Student:              Szogyenyi Zoltan
Anul:                 I
Materie:              Stagiu de Practica
Limbaj de programare: C
Data:                 Martie 21 2015 - Sambata

2. Se citesc de la tastatură elementele unei matrici de caractere (nr. linii=nr.
coloane), A(NxN), N<=10.

a) Să se afişeze matricea A;

b) Să se formeze şi să se afişeze cuvântul format din caracterele pe pe
diagonala principală a matricii A;

c) Să se calculeze şi să se afişeze numărul de litere mari, litere mici şi cifre din
matrice;

d) Să se afişeze cuvântul format din caracterele de pe diagonala secundară;

e) Să se afişeze procentul literelor mari, al literelor mici şi al cifrelor de pe cele 2
diagonale;

f) Să se afişeze caracterele comune aflate pe liniile p şi q (p, q < N, p şi q citite
de la tastatură);

g) Să se afişeze in ordine alfabetică, crescătoare, literele mari aflate pe
coloanele impare

*/

#include <stdio.h>

void printMatrix(int matrix[10][10], int);

int main()
{
	int a[10][10];
	int n;

	// Se citesc de la tastatură elementele unei matrici de caractere (nr. linii=nr.coloane), A(NxN), N<=10.
	printf("The size of the matrix: ");
	scanf("%d", &n);

	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j < n; ++j)
		{
			printf("a[%d][%d]= ", i, j);
			scanf("%d", &a[i][j]);
		}
	}

	// a) Să se afişeze matricea A;
	printMatrix(a, n);

	return 0;
}

void printMatrix(int matrix[10][10], int n)
{
	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j < n; ++j)
		{
			printf("%d ", matrix[i][j]);
		}
		printf("\n");
	}
}

Add the reading and printing of the matrix.


/*
 * QLogic Fibre Channel HBA Driver
 * Copyright (c)  2003-2013 QLogic Corporation
 *
 * See LICENSE.qla2xxx for copyright and licensing details.
 */
/*
 * Driver version
 */
#define QLA2XXX_VERSION      "8.04.00.08-k"

#define QLA_DRIVER_MAJOR_VER	8
#define QLA_DRIVER_MINOR_VER	4
#define QLA_DRIVER_PATCH_VER	0
#define QLA_DRIVER_BETA_VER	0

/*
 * QLogic Fibre Channel HBA Driver
 * Copyright (c)  2003-2013 QLogic Corporation
 *
 * See LICENSE.qla2xxx for copyright and licensing details.
 */
/*
 * Driver version
 */
#define QLA2XXX_VERSION      "8.04.00.13-k"

#define QLA_DRIVER_MAJOR_VER	8
#define QLA_DRIVER_MINOR_VER	4
#define QLA_DRIVER_PATCH_VER	0
#define QLA_DRIVER_BETA_VER	0

[SCSI] qla2xxx: Update the driver version to 8.04.00.13-k.

Signed-off-by: Giridhar Malavali <799b6491fce2c7a80b5fedcf9a728560cc9eb954@qlogic.com>
Signed-off-by: Saurav Kashyap <88d6fd94e71a9ac276fc44f696256f466171a3c0@qlogic.com>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>


/*
 * QLogic iSCSI HBA Driver
 * Copyright (c)  2003-2012 QLogic Corporation
 *
 * See LICENSE.qla4xxx for copyright and licensing details.
 */

#define QLA4XXX_DRIVER_VERSION	"5.03.00-k6"

/*
 * QLogic iSCSI HBA Driver
 * Copyright (c)  2003-2012 QLogic Corporation
 *
 * See LICENSE.qla4xxx for copyright and licensing details.
 */

#define QLA4XXX_DRIVER_VERSION	"5.03.00-k7"

Update driver version to 5.03.00-k7

[SCSI] qla4xxx: Update driver version to 5.03.00-k7

Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>


//
//  BNCDeviceInfo.h
//  Branch-TestBed
//
//  Created by Sojan P.R. on 3/22/16.
//  Copyright © 2016 Branch Metrics. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifndef BNCDeviceInfo_h
#define BNCDeviceInfo_h

#endif /* BNCDeviceInfo_h */

@interface BNCDeviceInfo : NSObject

//---------Properties-------------//
@property (nonatomic, strong) NSString *hardwareId;
@property (nonatomic, strong) NSString *hardwareIdType;
@property (nonatomic) BOOL isRealHardwareId;
@property (nonatomic, strong) NSString *vendorId;
@property (nonatomic, strong) NSString *brandName;
@property (nonatomic, strong) NSString *modelName;
@property (nonatomic, strong) NSString *osName;
@property (nonatomic, strong) NSString *osVersion;
@property (nonatomic) NSNumber *screenWidth;
@property (nonatomic) NSNumber *screenHeight;
@property (nonatomic) BOOL isAdTrackingEnabled;

//----------Methods----------------//
+ (BNCDeviceInfo *)getInstance;

@end

//
//  BNCDeviceInfo.h
//  Branch-TestBed
//
//  Created by Sojan P.R. on 3/22/16.
//  Copyright © 2016 Branch Metrics. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifndef BNCDeviceInfo_h
#define BNCDeviceInfo_h

#endif /* BNCDeviceInfo_h */

@interface BNCDeviceInfo : NSObject

//---------Properties-------------//
@property (nonatomic, strong) NSString *hardwareId;
@property (nonatomic, strong) NSString *hardwareIdType;
@property (nonatomic) BOOL isRealHardwareId;
@property (nonatomic, strong) NSString *vendorId;
@property (nonatomic, strong) NSString *brandName;
@property (nonatomic, strong) NSString *modelName;
@property (nonatomic, strong) NSString *osName;
@property (nonatomic, strong) NSString *osVersion;
@property (nonatomic, strong) NSNumber *screenWidth;
@property (nonatomic, strong) NSNumber *screenHeight;
@property (nonatomic) BOOL isAdTrackingEnabled;

//----------Methods----------------//
+ (BNCDeviceInfo *)getInstance;

@end

Change property attribute to strong

Change property attribute to strong


#ifndef JTL_HASH_MAP_H__
#define JTL_HASH_MAP_H__
#include <memory>

namespace jtl {

template <typename Key,
          typename Value>
class HashMap {

  struct MapNode {
    MapNode(Key k, Value v) : key(k), value(v) {}
    ~MapNode() {
      delete key;
      delete value;
    }

    Key key;
    Value value;
  }; // struct MapNode

  class HashMapBase_ {
    private:
      // bins is an array of pointers to arrays of key-value nodes
      MapNode** bins_;

  }; // class HashMapBase_
  public:
  private:
    Key* bins_;
}; // class HashMap
} // namespace jtl
#endif

#ifndef JTL_FLAT_HASH_MAP_H__
#define JTL_FLAT_HASH_MAP_H__
#include <memory>
#include <cctype>

namespace jtl {

template <typename Key>
struct Hash {
  using argument_type = Key;
  using result_type = std::size_t;

  result_type operator()(const Key& k);
}; // struct Hash

template <typename Key,
          typename Value>
class FlatHashMap {
  public:
    FlatHashMap() : bins_(), hash_() {}
  struct MapNode {
    MapNode(Key k, Value v) : key(k), value(v) {}

    Key key;
    Value value;
  }; // struct MapNode

  private:
  std::vector<std::vector<MapNode>> bins_;
  Hash<Key> hash_;
}; // class HashMap
} // namespace jtl
#endif // JTL_FLAT_HASH_MAP__

Switch hash map class to a flat hash map


#pragma once

#include <vector>

class HotkeyInfo {
public:
    enum HotkeyActions {
        IncreaseVolume,
        DecreaseVolume,
        SetVolume,
        Mute,
        VolumeSlider,
        RunApp,
        Settings,
        Exit,
    };
    static std::vector<std::wstring> ActionNames;

public:
    int keyCombination = 0;
    int action = -1;

};

#pragma once

#include <vector>

class HotkeyInfo {
public:
    enum HotkeyActions {
        IncreaseVolume,
        DecreaseVolume,
        SetVolume,
        Mute,
        VolumeSlider,
        RunApp,
        Settings,
        Exit,
    };
    static std::vector<std::wstring> ActionNames;

public:
    int keyCombination = 0;
    int action = -1;
    std::vector<std::wstring> args;

};

Add instance var for hotkey arguments

Add instance var for hotkey arguments


//
//  CRToast
//  Copyright (c) 2014-2015 Collin Ruffenach. All rights reserved.
//

#import <UIKit/UIKit.h>

//! Project version number for CRToast.
FOUNDATION_EXPORT double CRToastVersionNumber;

//! Project version string for CRToast.
FOUNDATION_EXPORT const unsigned char CRToastVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <CRToast/PublicHeader.h>

#import <CRToast/CRToastConfig.h>
#import <CRToast/CRToastManager.h>

//
//  CRToast
//  Copyright (c) 2014-2015 Collin Ruffenach. All rights reserved.
//

#import <UIKit/UIKit.h>

//! Project version number for CRToast.
FOUNDATION_EXPORT double CRToastVersionNumber;

//! Project version string for CRToast.
FOUNDATION_EXPORT const unsigned char CRToastVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <CRToast/PublicHeader.h>

#import "CRToast/CRToastConfig.h"
#import "CRToast/CRToastManager.h"

Fix build error with import

Fix build error with import


/*
 * dialer - MeeGo Voice Call Manager
 * Copyright (c) 2009, 2010, Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Apache License, version 2.0.  The full text of the Apache License is at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 */

#ifndef GENERICPAGE_H
#define GENERICPAGE_H

#include <MApplicationPage>

class MainWindow;
class MLayout;
class MGridLayoutPolicy;

class GenericPage : public MApplicationPage
{
    Q_OBJECT

public:

    enum PageType {
        PAGE_NONE     = -1,
        PAGE_DIALER   =  0,
        PAGE_RECENT   =  1,
        PAGE_PEOPLE   =  2,
        PAGE_FAVORITE =  3,
        PAGE_DEBUG    =  4,
    };

    GenericPage();
    virtual ~GenericPage();
    virtual void createContent();
    virtual MGridLayoutPolicy * policy(M::Orientation);

    MainWindow *mainWindow();

protected:
    virtual void showEvent(QShowEvent *event);
    virtual void activateWidgets();
    virtual void deactivateAndResetWidgets();

    MLayout *           layout;
    MGridLayoutPolicy * landscape;
    MGridLayoutPolicy * portrait;
    PageType            m_pageType;
};

#endif // GENERICPAGE_H

/*
 * dialer - MeeGo Voice Call Manager
 * Copyright (c) 2009, 2010, Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Apache License, version 2.0.  The full text of the Apache License is at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 */

#ifndef GENERICPAGE_H
#define GENERICPAGE_H

#include <MApplicationPage>

class MainWindow;
class MLayout;
class MGridLayoutPolicy;

class GenericPage : public MApplicationPage
{
    Q_OBJECT

public:

    enum PageType {
        PAGE_NONE     = -1,
        PAGE_DIALER   =  0,
        PAGE_RECENT   =  1,
        PAGE_PEOPLE   =  2,
        PAGE_FAVORITE =  3,
        PAGE_DEBUG    =  4,
    };

    GenericPage();
    virtual ~GenericPage();
    virtual void createContent();
    virtual MGridLayoutPolicy * policy(M::Orientation);

    virtual void activateWidgets();
    virtual void deactivateAndResetWidgets();

    MainWindow *mainWindow();

protected:
    virtual void showEvent(QShowEvent *event);

    MLayout *           layout;
    MGridLayoutPolicy * landscape;
    MGridLayoutPolicy * portrait;
    PageType            m_pageType;
};

#endif // GENERICPAGE_H

Make the genericPage methods activate and deactivate widgets public instead of protected.

Signed-off-by: Michael Demeter <ed571e93df5b6cb8044d8ad4bd1aafe6e72f2a71@intel.com>


#import "PromiseKit/Promise.h"
#ifdef PMK_CORELOCATION
#import "PromiseKit+CoreLocation.h"
#endif
#ifdef PMK_FOUNDATION
#import "PromiseKit+Foundation.h"
#endif
#ifdef PMK_UIKIT
#import "PromiseKit+UIKit.h"
#endif
#ifdef PMK_MAPKIT
#import "PromiseKit+MapKit.h"
#endif
#ifdef PMK_SOCIAL
#import "PromiseKit+Social.h"
#endif
#ifdef PMK_STOREKIT
#import "PromiseKit+StoreKit.h"
#endif
#ifdef PMK_AVFOUNDATION
#import "PromiseKit+AVFoundation.h"
#endif

#ifndef PMK_NO_UNPREFIXATION
// I used a typedef but it broke the tests, turns out typedefs are new
// types that have consequences with isKindOfClass and that
// NOTE I will remove this at 1.0
typedef PMKPromise Promise __attribute__((deprecated("Use PMKPromise. Use of Promise is deprecated. This is a typedef, and since it is a typedef, there may be unintended side-effects.")));
#endif

#import "PromiseKit/Promise.h"
#ifdef PMK_CORELOCATION
#import "PromiseKit+CoreLocation.h"
#endif
#ifdef PMK_FOUNDATION
#import "PromiseKit+Foundation.h"
#endif
#ifdef PMK_UIKIT
#import "PromiseKit+UIKit.h"
#endif
#ifdef PMK_MAPKIT
#import "PromiseKit+MapKit.h"
#endif
#ifdef PMK_SOCIAL
#import "PromiseKit+Social.h"
#endif
#ifdef PMK_STOREKIT
#import "PromiseKit+StoreKit.h"
#endif
#ifdef PMK_AVFOUNDATION
#import "PromiseKit+AVFoundation.h"
#endif
#ifdef PMK_ACCOUNTS
#import "PromiseKit+Accounts.h"
#endif

#ifndef PMK_NO_UNPREFIXATION
// I used a typedef but it broke the tests, turns out typedefs are new
// types that have consequences with isKindOfClass and that
// NOTE I will remove this at 1.0
typedef PMKPromise Promise __attribute__((deprecated("Use PMKPromise. Use of Promise is deprecated. This is a typedef, and since it is a typedef, there may be unintended side-effects.")));
#endif

Add missing import to umbrella header

Add missing import to umbrella header


#ifndef __SimpleITKMacro_h
#define __SimpleITKMacro_h

#include <stdint.h>
#include <itkImageBase.h>
#include <itkImage.h>
#include <itkLightObject.h>
#include <itkSmartPointer.h>

// Define macros to aid in the typeless layer
typedef itk::ImageBase<3> SimpleImageBase;

namespace itk {
  namespace simple {

    // To add a new type you must:
    // 1. Add an entry to ImageDataType
    // 2. Add to the sitkDataTypeSwitch
    // 3. Add the new type to ImageFileReader/ImageFileWriter

    enum ImageDataType {
      sitkUInt8,    // Unsigned 8 bit integer
      sitkInt16,   // Signed 16 bit integer
      sitkInt32,   // Signed 32 bit integer
      sitkFloat32,  // 32 bit float
    };

#define sitkImageDataTypeCase(typeN, type, call ) \
    case typeN: { typedef type DataType; call; }; break

#define sitkImageDataTypeSwitch( call ) \
    sitkImageDataTypeCase ( sitkUInt8, uint8_t, call ); \
    sitkImageDataTypeCase ( sitkInt16, int16_t, call ); \
    sitkImageDataTypeCase ( sitkInt32, int32_t, call ); \
    sitkImageDataTypeCase ( sitkFloat32, float, call );

  }
}

#endif

#ifndef __SimpleITKMacro_h
#define __SimpleITKMacro_h

// Ideally, take the types from the C99 standard.  However,
// VS 8 does not have stdint.h, but they are defined anyway.
#ifndef _MSC_VER
	#include <stdint.h>
#endif

#include <itkImageBase.h>
#include <itkImage.h>
#include <itkLightObject.h>
#include <itkSmartPointer.h>

// Define macros to aid in the typeless layer
typedef itk::ImageBase<3> SimpleImageBase;

namespace itk {
  namespace simple {

    // To add a new type you must:
    // 1. Add an entry to ImageDataType
    // 2. Add to the sitkDataTypeSwitch
    // 3. Add the new type to ImageFileReader/ImageFileWriter

    enum ImageDataType {
      sitkUInt8,    // Unsigned 8 bit integer
      sitkInt16,   // Signed 16 bit integer
      sitkInt32,   // Signed 32 bit integer
      sitkFloat32,  // 32 bit float
    };

#define sitkImageDataTypeCase(typeN, type, call ) \
    case typeN: { typedef type DataType; call; }; break

#define sitkImageDataTypeSwitch( call ) \
    sitkImageDataTypeCase ( sitkUInt8, uint8_t, call ); \
    sitkImageDataTypeCase ( sitkInt16, int16_t, call ); \
    sitkImageDataTypeCase ( sitkInt32, int32_t, call ); \
    sitkImageDataTypeCase ( sitkFloat32, float, call );

  }
}

#endif

Support for MS Visual Studio 2008.

Support for MS Visual Studio 2008.


// RUN: %llvmgcc %s -c -m32 -fasm-blocks -o /dev/null
// This should not warn about unreferenced label. 7729514.
// XFAIL: *
// XTARGET: i386-apple-darwin,x86_64-apple-darwin,i686-apple-darwin

void quarterAsm(int array[], int len)
{
  __asm
  {
    mov esi, array;
    mov ecx, len;
    shr ecx, 2;
loop:
    movdqa xmm0, [esi];
    psrad xmm0, 2;
    movdqa [esi], xmm0;
    add esi, 16;
    sub ecx, 1;
    jnz loop;
  }
}

// RUN: %llvmgcc %s -c -m32 -fasm-blocks -o /dev/null
// This should not warn about unreferenced label. 7729514.
// XFAIL: *
// XTARGET: x86,i386,i686

void quarterAsm(int array[], int len)
{
  __asm
  {
    mov esi, array;
    mov ecx, len;
    shr ecx, 2;
loop:
    movdqa xmm0, [esi];
    psrad xmm0, 2;
    movdqa [esi], xmm0;
    add esi, 16;
    sub ecx, 1;
    jnz loop;
  }
}

Fix this XTARGET so that this does doesn't XPASS on non-darwin hosts.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@108040 91177308-0d34-0410-b5e6-96231b3b80d8


// MIT License

// Copyright (c) 2017 Zhuhao Wang

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#pragma once

#include <memory>

#include <boost/noncopyable.hpp>

namespace nekit {
namespace crypto {

enum class ErrorCode { NoError, ValidationFailed };

enum class Action { Decryption = 0, Encryption = 1 };

// This class provide support for stream cipher or block cipher in stream mode.
class StreamCipherInterface: private boost::noncopyable {
 public:
  virtual ~StreamCipherInterface() = default;

  virtual void SetKey(const uint8_t *data, bool copy) = 0;
  virtual void SetIv(const uint8_t *data, bool copy) = 0;

  virtual ErrorCode Process(const uint8_t *input, size_t len,
                            const uint8_t *input_tag, uint8_t *output,
                            uint8_t *output_tag) = 0;

  virtual void Reset() = 0;

  virtual size_t key_size() = 0;
  virtual size_t iv_size() = 0;
  virtual size_t block_size() = 0;
  virtual size_t tag_size() = 0;
};
}  // namespace crypto
}  // namespace nekit

Add interface for stream cipher

FEAT: Add interface for stream cipher


//
//  MustacheToken.h
//  OCMustache
//
//  Created by Wesley Moore on 31/10/10.
//  Copyright 2010 Wesley Moore. All rights reserved.
//

#import <Foundation/Foundation.h>

enum mustache_token_type {
	mustache_token_type_etag = 1, // Escaped tag
	mustache_token_type_utag, // Unescaped tag
	mustache_token_type_section,
	mustache_token_type_inverted,
	mustache_token_type_static, // Static text
	mustache_token_type_partial
};

@interface MustacheToken : NSObject {
	enum mustache_token_type type;
	const char *content;
	NSUInteger content_length;
}

@property(nonatomic, assign) enum mustache_token_type type;
@property(nonatomic, assign) const char *content;
@property(nonatomic, assign) size_t contentLength;

- (id)initWithType:(enum mustache_token_type)token_type content:(const char *)content contentLength:(NSUInteger)length;
- (NSString *)contentString;

@end

//
//  MustacheToken.h
//  OCMustache
//
//  Created by Wesley Moore on 31/10/10.
//  Copyright 2010 Wesley Moore. All rights reserved.
//

#import <Foundation/Foundation.h>

enum mustache_token_type {
	mustache_token_type_etag = 1, // Escaped tag
	mustache_token_type_utag, // Unescaped tag
	mustache_token_type_section,
	mustache_token_type_inverted,
	mustache_token_type_static, // Static text
	mustache_token_type_partial
};

@interface MustacheToken : NSObject {
	enum mustache_token_type type;
	const char *content;
	NSUInteger content_length;
}

@property(nonatomic, assign) enum mustache_token_type type;
@property(nonatomic, assign) const char *content;
@property(nonatomic, assign) NSUInteger contentLength;

- (id)initWithType:(enum mustache_token_type)token_type content:(const char *)content contentLength:(NSUInteger)length;
- (NSString *)contentString;

@end

Fix type mismatch between property and ivar


/*
 * Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef _VOTCA_CSG_GMXTOPOLOGYREADER_H
#define _VOTCA_CSG_GMXTOPOLOGYREADER_H

#include <string>
#include <votca/csg/topologyreader.h>

namespace votca {
namespace csg {

/**
    \brief reader for gromacs topology files

    This class encapsulates the gromacs reading functions and provides an
   interface to fill a topolgy class

*/
class GMXTopologyReader : public TopologyReader {
 public:
  GMXTopologyReader() = default;

  /// read a topology file
  bool ReadTopology(std::string file, Topology &top) override;

 private:
};

}  // namespace csg
}  // namespace votca

#endif /* _VOTCA_CSG_GMXTOPOLOGYREADER_H */

/*
 * Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef _VOTCA_CSG_GMXTOPOLOGYREADER_H
#define _VOTCA_CSG_GMXTOPOLOGYREADER_H

#include <string>
#include <votca/csg/topologyreader.h>
#include <votca/tools/unitconverter.h>

namespace votca {
namespace csg {

/**
    \brief reader for gromacs topology files

    This class encapsulates the gromacs reading functions and provides an
   interface to fill a topolgy class

*/
class GMXTopologyReader : public TopologyReader {
 public:
  GMXTopologyReader() = default;

  /// read a topology file
  bool ReadTopology(std::string file, Topology &top) override;

 private:
};

}  // namespace csg
}  // namespace votca

#endif /* _VOTCA_CSG_GMXTOPOLOGYREADER_H */

Add unitconverter include to gmx top reader


/*
 * Copyright (c) 2012 Israel Jacques
 * See LICENSE for details.
 *
 * Israel Jacques <mrko@eecs.berkeley.edu>
 */

#ifndef _DRAM_CARTRIDGE_H__
#define _DRAM_CARTRIDGE_H__

extern void dram_init(void);

#endif /* !_DRAM_CARTRIDGE_H_

/*
 * Copyright (c) 2012 Israel Jacques
 * See LICENSE for details.
 *
 * Israel Jacques <mrko@eecs.berkeley.edu>
 */

#ifndef _DRAM_CARTRIDGE_H__
#define _DRAM_CARTRIDGE_H__

extern void dram_cartridge_init(void);

#endif /* !_DRAM_CARTRIDGE_H_

Change incorrect prototype from 'dram_init(void)' to 'dram_cartridge_init(void)'


// PARAM: --enable ana.int.interval --enable exp.partition-arrays.enabled --set ana.activated "['base', 'mallocWrapper']"
int main(void) {
    // Shifting by a negative number is UB, but we should still not crash on it, but go to top instead
    int v = -1;
    int r = 17;
    int u = r >> v;
}

Test for shift by negative

Test for shift by negative


/*
 * Copyright (c) 2012 Israel Jacquez
 * See LICENSE for details.
 *
 * Israel Jacquez <mrkotfw@gmail.com>
 */

#ifndef _SLOB_H_
#define _SLOB_H_

#include <stddef.h>

/*-
 * Restrictions
 *
 *   1. Allocation requests bigger than SLOB_PAGE_BREAK_2ND cannot be
 *      serviced. This is due to the memory block manager not able to
 *      guarantee that sequential allocations of SLOB pages will be
 *      contiguous.
 */

/*
 * Adjust the number of pages to be statically allocated as needed. If
 * memory is quickly exhausted, increase the SLOB page count.
 */
#ifndef SLOB_PAGE_COUNT
#define SLOB_PAGE_COUNT 4
#endif /* !SLOB_PAGE_COUNT */

#define SLOB_PAGE_SIZE  0x1000
#define SLOB_PAGE_MASK  (~(SLOB_PAGE_SIZE - 1))

#define SLOB_PAGE_BREAK_1ST 0x0100
#define SLOB_PAGE_BREAK_2ND 0x0400

void slob_init(void);
void *slob_alloc(size_t);
void slob_free(void *);

#endif /* _SLOB_H_ */

/*
 * Copyright (c) 2012 Israel Jacquez
 * See LICENSE for details.
 *
 * Israel Jacquez <mrkotfw@gmail.com>
 */

#ifndef _SLOB_H_
#define _SLOB_H_

#include <stddef.h>

/*-
 * Restrictions
 *
 *   1. Heap size limit: Allocation requests bigger than
 *      SLOB_PAGE_BREAK_2ND cannot be serviced. This is due to the
 *      memory block manager not able to guarantee that sequential
 *      allocations of SLOB pages will be contiguous.
 */

/*
 * Adjust the number of pages to be statically allocated as needed. If
 * memory is quickly exhausted, increase the SLOB page count.
 */
#ifndef SLOB_PAGE_COUNT
#define SLOB_PAGE_COUNT 4
#endif /* !SLOB_PAGE_COUNT */

#define SLOB_PAGE_SIZE  0x4000
#define SLOB_PAGE_MASK  (~(SLOB_PAGE_SIZE - 1))

#define SLOB_PAGE_BREAK_1ST 0x0100
#define SLOB_PAGE_BREAK_2ND 0x0400

void slob_init(void);
void *slob_alloc(size_t);
void slob_free(void *);

#endif /* _SLOB_H_ */

Change hard limit on heap

Change hard limit on heap


// PARAM: --sets solver td3 --set ana.activated "['base','threadid','threadflag','octagon','mallocWrapper']"
// Example from https://github.com/sosy-lab/sv-benchmarks/blob/master/c/recursive-simple/afterrec_2calls-1.c

void f(int);
void f2(int);

void f(int n) {
  if (n<3) return;
  n--;
  f2(n);
  assert(1);
}

void f2(int n) {
  if (n<3) return;
  n--;
  f(n);
  assert(1);
}

int main(void) {
  f(4);
}

Add further issue with recursion

Add further issue with recursion


/**
 * Using the HAL library
 */

#include "stm32l0xx.h"
#include "stm32l0xx_nucleo.h"

int main(void) {

	HAL_Init();
	BSP_LED_Init(LED2);

	while (1) {
		BSP_LED_Toggle(LED2);
		HAL_Delay(500);
	}

}

/**
 * Using the HAL library
 */

#include "stm32l0xx.h"
#include "stm32l0xx_nucleo.h"

GPIO_InitTypeDef GPIO_InitStructure;
int main(void) {

	HAL_Init();
	BSP_LED_Init(LED2);

	// Initialise the button (PC13)
	__HAL_RCC_GPIOC_CLK_ENABLE();
	GPIO_InitStructure.Pin = GPIO_PIN_13;
	GPIO_InitStructure.Mode = GPIO_MODE_INPUT;
	GPIO_InitStructure.Pull = GPIO_NOPULL; // External pull up
	GPIO_InitStructure.Speed = GPIO_SPEED_LOW;
	HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);

	while (1) {
		if (HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13)) {
			BSP_LED_Toggle(LED2);
			//HAL_Delay(500);
		}
	}

}

Read the button with the HAL library

Read the button with the HAL library


#ifndef MUSICMOBILEGLOBALDEFINE_H
#define MUSICMOBILEGLOBALDEFINE_H

/* =================================================
 * This file is part of the TTK Music Player project
 * Copyright (c) 2015 - 2017 Greedysky Studio
 * All rights reserved!
 * Redistribution and use of the source code or any derivative
 * works are strictly forbiden.
   =================================================*/

#include "musicglobal.h"

//////////////////////////////////////
///exoprt
///
///
#define MUSIC_EXPORT

#ifdef MUSIC_EXPORT
#  define MUSIC_MOBILE_EXPORT Q_DECL_EXPORT
#else
#  define MUSIC_MOBILE_EXPORT Q_DECL_IMPORT
#endif

#endif // MUSICMOBILEGLOBALDEFINE_H

#ifndef MUSICMOBILEGLOBALDEFINE_H
#define MUSICMOBILEGLOBALDEFINE_H

/* =================================================
 * This file is part of the TTK Music Player project
 * Copyright (c) 2015 - 2017 Greedysky Studio
 * All rights reserved!
 * Redistribution and use of the source code or any derivative
 * works are strictly forbiden.
   =================================================*/

#include "musicglobal.h"

//////////////////////////////////////
///exoprt
///
///
#define MUSIC_EXPORT

#ifdef MUSIC_EXPORT
#  define MUSIC_MOBILE_EXPORT Q_DECL_EXPORT
#else
#  define MUSIC_MOBILE_IMPORT Q_DECL_IMPORT
#endif

#endif // MUSICMOBILEGLOBALDEFINE_H

Fix dll import name error[132001]

Fix dll import name error[132001]


#include <json_spirit.h>

namespace sqlite {
	// json_spirit::mArray
	template<> void get_col_from_db(database_binder& db, int inx, json_spirit::mArray& a) {

		json_spirit::mValue tmp;
		std::string str((char*)sqlite3_column_blob(db._stmt, inx), sqlite3_column_bytes(db._stmt, inx));
		json_spirit::read(str, tmp);

		a = tmp.get_array();
	}

	template<> database_binder& operator <<(database_binder& db, const json_spirit::mArray& val) {
		auto tmp = json_spirit::write(val);
		if(sqlite3_bind_blob(db._stmt, db._inx, tmp.c_str() , tmp.size() , SQLITE_TRANSIENT) != SQLITE_OK) {
			db.throw_sqlite_error();
		}

		++db._inx;
		return db;
	}

	// json_spirit::mObject
	template<> void get_col_from_db(database_binder& db, int inx, json_spirit::mObject& a) {

		json_spirit::mValue tmp;
		std::string str((char*)sqlite3_column_blob(db._stmt, inx), sqlite3_column_bytes(db._stmt, inx));
		json_spirit::read(str, tmp);

		a = tmp.get_obj();
	}

	template<> database_binder& operator <<(database_binder& db, const json_spirit::mObject& val) {
		auto tmp = json_spirit::write(val);
		if(sqlite3_bind_blob(db._stmt, db._inx, tmp.c_str(), tmp.size(), SQLITE_TRANSIENT) != SQLITE_OK) {
			db.throw_sqlite_error();
		}

		++db._inx;
		return db;
	}
}

Boost json::spirit support for mArrays and mObjects


/*-------------------------------------------------------------------------
 *
 * resource_manager.c
 *	  GPDB resource manager code.
 *
 *
 * Copyright (c) 2006-2017, Greenplum inc.
 *
 *
 -------------------------------------------------------------------------
 */
#include "postgres.h"

#include "utils/guc.h"
#include "utils/resource_manager.h"

/*
 * GUC variables.
 */
bool	ResourceScheduler;						/* Is scheduling enabled? */
ResourceManagerPolicy Gp_resource_manager_policy;

/*-------------------------------------------------------------------------
 *
 * resource_manager.c
 *	  GPDB resource manager code.
 *
 *
 * Copyright (c) 2006-2017, Greenplum inc.
 *
 *
 -------------------------------------------------------------------------
 */
#include "postgres.h"

#include "utils/guc.h"
#include "utils/resource_manager.h"

/*
 * GUC variables.
 */
bool	ResourceScheduler = false;						/* Is scheduling enabled? */
ResourceManagerPolicy Gp_resource_manager_policy;

Initialize global var to avoid macOS linker error

The macOS ld64 linker has an assertion on empty DATA segments
within linker Atoms. This assertion trips on the resource_manager
since it only contains uninitialized variables placed for the BSS
segment. This fails linking the backend on the resource_manager
SUBSYS object. Without anything initialized, an no exported
function symbols, the sections are:

$ nm -mgU src/backend/utils/resource_manager/SUBSYS.o
0000000000000004 (common) (alignment 2^2) external _Gp_resource_manager_policy
0000000000000001 (common) external _ResourceScheduler

With the initialization of the ResourceScheduler GUC variable:

$ nm -mgU src/backend/utils/resource_manager/SUBSYS.o
0000000000000004 (common) (alignment 2^2) external _Gp_resource_manager_policy
0000000000000004 (__DATA,__common) external _ResourceScheduler

Since the resource_manager in its current state is off anyways it
seems harmless to initialize to the correct value.


#include <stdio.h>
#include <time.h>

int multiples_three_five(int limit)
{
    long total = 0;

    int i;
    for (i=1; i < limit; i++)
        total += i % 3 == 0 || i % 5 == 0 ? i : 0;
    return total;
}

int main(void)
{
    clock_t start, stop;

    start = clock();
    long ans = multiples_three_five(1000);

    printf ("Answer: %ld\n", ans);

    stop = clock();
    printf ("Time: %f\n", ((float)stop - (float)start) / CLOCKS_PER_SEC);

    return 0;
}

#include <time.h>
#include <stdio.h>

#define NANO 10000000000

int multiples_three_five(int limit)
{
    long total = 0;

    for (int i=1; i < limit; i++)
        total += i % 3 == 0 || i % 5 == 0 ? i : 0;

    return total;
}

int main(void)
{
    struct timespec start;
    clock_gettime(CLOCK_REALTIME, &start);
    double start_time = ((float) start.tv_sec) + ((float) start.tv_nsec) / NANO;

    long ans = multiples_three_five(1000);
    printf ("Answer: %ld\n", ans);

    struct timespec stop;
    clock_gettime(CLOCK_REALTIME, &stop);
    double stop_time = ((float) stop.tv_sec) + ((float) stop.tv_nsec) / NANO;

    printf ("Time: %.8f\n", stop_time - start_time);

    return 0;
}

Use WALL time for timer

Use WALL time for timer


#ifndef __COLLECTOR_H__
#define __COLLECTOR_H__

#include "sched.h"

enum AdTypes
{
    STARTD_AD,
    SCHEDD_AD,
    MASTER_AD,
    GATEWAY_AD,
    CKPT_SRVR_AD,

    NUM_AD_TYPES
};

// collector commands
const int UPDATE_STARTD_AD       = 0;
const int UPDATE_SCHEDD_AD       = 1;
const int UPDATE_MASTER_AD       = 2;
const int UPDATE_GATEWAY_AD      = 3;
const int UPDATE_CKPT_SRVR_AD  = 4;

const int QUERY_STARTD_ADS       = 5;
const int QUERY_SCHEDD_ADS       = 6;
const int QUERY_MASTER_ADS       = 7;
const int QUERY_GATEWAY_ADS      = 8;
const int QUERY_CKPT_SRVR_ADS  = 9;

#endif // __COLLECTOR_H__

#ifndef __COLLECTOR_H__
#define __COLLECTOR_H__

#include "sched.h"

enum AdTypes
{
    STARTD_AD,
    SCHEDD_AD,
    MASTER_AD,
    GATEWAY_AD,
    CKPT_SRVR_AD,

    NUM_AD_TYPES
};

#include "condor_commands.h"   // collector commands

#endif // __COLLECTOR_H__

Use condor_commands.h instead of defining commands here.


/**
 * @file
 * Hashing module documentation file.
 */

/**
 * @addtogroup hashing_module Hashing module
 *
 * The Hashing module provides one-way hashing functions. Such functions can be
 * used for creating a hash message authentication code (HMAC) when sending a
 * message. Such a HMAC can be used in combination with a private key
 * for authentication, which is a message integrity control.
 *
 * All hash algorithms can be accessed via the generic MD layer (see
 * \c md_init_ctx())
 *
 * The following hashing-algorithms are provided:
 * - MD2, MD4, MD5 128-bit one-way hash functions by Ron Rivest (see
 *   \c md2_hmac(), \c md4_hmac() and \c md5_hmac()).
 * - SHA-1, SHA-256, SHA-384/512 160-bit or more one-way hash functions by
 *   NIST and NSA (see\c sha1_hmac(), \c sha256_hmac() and \c sha512_hmac()).
 *
 * This module provides one-way hashing which can be used for authentication.
 */

/**
 * @file
 * Hashing module documentation file.
 */

/**
 * @addtogroup hashing_module Hashing module
 *
 * The Hashing module provides one-way hashing functions. Such functions can be
 * used for creating a hash message authentication code (HMAC) when sending a
 * message. Such a HMAC can be used in combination with a private key
 * for authentication, which is a message integrity control.
 *
 * All hash algorithms can be accessed via the generic MD layer (see
 * \c md_init_ctx())
 *
 * The following hashing-algorithms are provided:
 * - MD2, MD4, MD5 128-bit one-way hash functions by Ron Rivest.
 * - SHA-1, SHA-256, SHA-384/512 160-bit or more one-way hash functions by
 *   NIST and NSA.
 *
 * This module provides one-way hashing which can be used for authentication.
 */

Update doxygen documentation on HMAC

Update doxygen documentation on HMAC


enum args {
        AIMM = 1,

        AIMM8,
        AIMM16,
        AIMM32,
        AIMM64,

	AREG_AX,
	AREG_AL,
	AREG_AH,
	AREG_EAX,

	AREG_BC,
	AREG_BL,
	AREG_BH,
	AREG_EBX,

	AREG_CX,
	AREG_CL,
	AREG_CH,
	AREG_ECX,

	AREG_DX,
	AREG_DL,
	AREG_DH,
	AREG_EDX,

	AREG_SI,
	AREG_DI,

	AREG_SP,
	AREG_ESP,
	AREG_EBP,

        AREP,
};

enum args {
        AIMM = 1,

        AIMM8,
        AIMM16,
        AIMM32,
        AIMM64,

	AREG_CS,
	AREG_DS,
	AREG_SS,
	AREG_ES
	AREG_FS,
	AREG_GS,

	AREG_EFLAGS,

	AREG_AX,
	AREG_AL,
	AREG_AH,
	AREG_EAX,
	AREG_RAX,

	AREG_BX,
	AREG_BL,
	AREG_BH,
	AREG_EBX,
	AREG_RBX,

	AREG_CX,
	AREG_CL,
	AREG_CH,
	AREG_ECX,
	AREG_RCX,

	AREG_DX,
	AREG_DL,
	AREG_DH,
	AREG_EDX,
	AREG_RDX,

	AREG_SI,
	AREG_DI,

	AREG_SP,
	AREG_ESP,
	AREG_RSP,

	AREG_BP,
	AREG_EBP,
	AREG_RBP,

        AREP,
};

Extend list of intel registers

[as] Extend list of intel registers


#ifndef __INC_PIXELS_H
#define __INC_PIXELS_H

#include <stdint.h>

struct CRGB {
	union {
		struct { uint8_t r; uint8_t g; uint8_t b; };
		uint8_t raw[3];
	};
};

#ifdef SUPPORT_ARGB
struct CARGB {
	union {
		struct { uint8_t a; uint8_t g; uint8_t r; uint8_t b; };
		uint8_t raw[4];
		uint32_t all32;
	};
};

#endif

struct CHSV {
    union {
        uint8_t hue;
        uint8_t h; };
    union {
        uint8_t saturation;
        uint8_t sat;
        uint8_t s; };
    union {
        uint8_t value;
        uint8_t val;
        uint8_t v; };
};

// Define RGB orderings
enum EOrder {
	RGB=0012,
	RBG=0021,
	GRB=0102,
	GBR=0120,
	BRG=0201,
	BGR=0210
};

#endif

#ifndef __INC_PIXELS_H
#define __INC_PIXELS_H

#include <stdint.h>

struct CRGB {
	union {
		struct { uint8_t r; uint8_t g; uint8_t b; };
		uint8_t raw[3];
	};
	inline uint8_t& operator[] (uint8_t x) __attribute__((always_inline)) { return raw[x]; }
};

#ifdef SUPPORT_ARGB
struct CARGB {
	union {
		struct { uint8_t a; uint8_t g; uint8_t r; uint8_t b; };
		uint8_t raw[4];
		uint32_t all32;
	};
};

#endif

struct CHSV {
	union {
		struct {
		    union {
		        uint8_t hue;
		        uint8_t h; };
		    union {
		        uint8_t saturation;
		        uint8_t sat;
		        uint8_t s; };
		    union {
		        uint8_t value;
		        uint8_t val;
		        uint8_t v; };
		};
		uint8_t raw[3];
	};
	inline uint8_t& operator[](uint8_t x) __attribute__((always_inline)) { return raw[x]; }

};

// Define RGB orderings
enum EOrder {
	RGB=0012,
	RBG=0021,
	GRB=0102,
	GBR=0120,
	BRG=0201,
	BGR=0210
};

#endif

Add raw array access to hsv structure, and operator[] operations to hsv and rgb classes


/*
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License version 2 as published by the Free Software Foundation.

   This library 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 GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
*/

#ifndef GLUON_CREATOR_COMPONENTSDOCK_H
#define GLUON_CREATOR_COMPONENTSDOCK_H

#include <../../home/ahiemstra/Projects/gluon/creator/lib/widgets/dock.h>

namespace Gluon {

namespace Creator {

class ComponentsDock : public Gluon::Creator::Dock
{
    public:
        ComponentsDock(const QString& title, QWidget* parent = 0, Qt::WindowFlags flags = 0);
        ~ComponentsDock();

        void setSelection(Gluon::GluonObject* obj = 0);
        QAbstractItemView* view();
        QAbstractItemModel* model();

    private:
        class ComponentsDockPrivate;
        ComponentsDockPrivate* d;
};

}

}

#endif // GLUON_CREATOR_COMPONENTSDOCK_H

/*
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License version 2 as published by the Free Software Foundation.

   This library 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 GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
*/

#ifndef GLUON_CREATOR_COMPONENTSDOCK_H
#define GLUON_CREATOR_COMPONENTSDOCK_H

#include "widgets/dock.h"

namespace Gluon {

namespace Creator {

class ComponentsDock : public Gluon::Creator::Dock
{
    public:
        ComponentsDock(const QString& title, QWidget* parent = 0, Qt::WindowFlags flags = 0);
        ~ComponentsDock();

        void setSelection(Gluon::GluonObject* obj = 0);
        QAbstractItemView* view();
        QAbstractItemModel* model();

    private:
        class ComponentsDockPrivate;
        ComponentsDockPrivate* d;
};

}

}

#endif // GLUON_CREATOR_COMPONENTSDOCK_H

Make creator compile without being on ahiemstra's machine ;)


// RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o %t %s
// RUN: grep 'declare i32 @f0() readnone$' %t
// RUN: grep 'declare i32 @f1() readonly$' %t
// RUN: grep 'declare void @f2(.* sret)$' %t
// RUN: grep 'declare void @f3(.* sret)$' %t
// RUN: grep 'declare void @f4(.* byval)$' %t
// RUN: grep 'declare void @f5(.* byval)$' %t
// PR3835

typedef int T0;
typedef struct { int a[16]; } T1;

T0 __attribute__((const)) f0(void);
T0 __attribute__((pure)) f1(void);
T1 __attribute__((const)) f2(void);
T1 __attribute__((pure)) f3(void);
void __attribute__((const)) f4(T1 a);
void __attribute__((pure)) f5(T1 a);

void *ps[] = { f0, f1, f2, f3, f4, f5 };

// RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o %t %s
// RUN: grep 'declare i32 @f0() readnone ;' %t
// RUN: grep 'declare i32 @f1() readonly ;' %t
// RUN: grep 'declare void @f2(.* sret) ;' %t
// RUN: grep 'declare void @f3(.* sret) ;' %t
// RUN: grep 'declare void @f4(.* byval) ;' %t
// RUN: grep 'declare void @f5(.* byval) ;' %t
// PR3835

typedef int T0;
typedef struct { int a[16]; } T1;

T0 __attribute__((const)) f0(void);
T0 __attribute__((pure)) f1(void);
T1 __attribute__((const)) f2(void);
T1 __attribute__((pure)) f3(void);
void __attribute__((const)) f4(T1 a);
void __attribute__((pure)) f5(T1 a);

void *ps[] = { f0, f1, f2, f3, f4, f5 };

Correct this test for the fact that the number of uses is now printed
in a comment.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@112813 91177308-0d34-0410-b5e6-96231b3b80d8


#ifndef VAST_ALIASES_H
#define VAST_ALIASES_H

#include <cstdint>
#include <limits>

namespace vast {

/// Uniquely identifies a VAST event.
using event_id = uint64_t;

/// The smallest possible event ID.
static constexpr event_id min_event_id = 1;

/// The largest possible event ID.
static constexpr event_id max_event_id =
  std::numeric_limits<event_id>::max() - 1;

/// Uniquely identifies a VAST type.
using type_id = uint64_t;

} // namespace vast

#endif

#ifndef VAST_ALIASES_H
#define VAST_ALIASES_H

#include <cstdint>
#include <limits>

namespace vast {

/// Uniquely identifies a VAST event.
using event_id = uint64_t;

/// The invalid event ID.
static constexpr event_id invalid_event_id = 0;

/// The smallest possible event ID.
static constexpr event_id min_event_id = 1;

/// The largest possible event ID.
static constexpr event_id max_event_id =
  std::numeric_limits<event_id>::max() - 1;

/// Uniquely identifies a VAST type.
using type_id = uint64_t;

} // namespace vast

#endif

Add alias for invalid event ID.

Add alias for invalid event ID.


#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H

//
// client versioning and copyright year
//

// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR       1
#define CLIENT_VERSION_MINOR       1
#define CLIENT_VERSION_REVISION    0
#define CLIENT_VERSION_BUILD       0

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE  true

// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2013

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X

#endif // CLIENTVERSION_H

#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H

//
// client versioning and copyright year
//

// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR       1
#define CLIENT_VERSION_MINOR       2
#define CLIENT_VERSION_REVISION    0
#define CLIENT_VERSION_BUILD       0

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE  true

// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2013

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X

#endif // CLIENTVERSION_H

Change client version number to 1.2.0.0

Change client version number to 1.2.0.0


#ifndef GH_DATASTORE_H
#define GH_DATASTORE_H

#include <sqlite3.h>

struct reading
{
  int   id;
  char *title;
  int   readmill_id;
  int   total_pages;
};

sqlite3 *gh_datastore_open_db (char *data_dir);

int gh_datastore_get_db_version (sqlite3 *db);
void gh_datastore_set_db_version (sqlite3 *db, int version);

#endif

#ifndef GH_DATASTORE_H
#define GH_DATASTORE_H

#include <sqlite3.h>

typedef struct
{
  int   id;
  char *title;
  int   readmill_id;
  int   total_pages;
} Reading;

sqlite3 *gh_datastore_open_db (char *data_dir);

int gh_datastore_get_db_version (sqlite3 *db);
void gh_datastore_set_db_version (sqlite3 *db, int version);

#endif

Use typedef for reading struct

Use typedef for reading struct


// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This header will be kept up to date so that we can compile system-call
// policies even when system headers are old.
// System call numbers are accessible through __NR_syscall_name.

#ifndef SANDBOX_LINUX_SERVICES_LINUX_SYSCALLS_H_
#define SANDBOX_LINUX_SERVICES_LINUX_SYSCALLS_H_

#if defined(__x86_64__)
#include "sandbox/linux/services/x86_64_linux_syscalls.h"
#endif

#if defined(__i386__)
#include "sandbox/linux/services/x86_32_linux_syscalls.h"
#endif

#if defined(__arm__) && defined(__ARM_EABI__)
#include "sandbox/linux/services/arm_linux_syscalls.h"
#endif

#if defined(__mips__)
#include "sandbox/linux/services/mips_linux_syscalls.h"
#endif

#endif  // SANDBOX_LINUX_SERVICES_LINUX_SYSCALLS_H_

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This header will be kept up to date so that we can compile system-call
// policies even when system headers are old.
// System call numbers are accessible through __NR_syscall_name.

#ifndef SANDBOX_LINUX_SERVICES_LINUX_SYSCALLS_H_
#define SANDBOX_LINUX_SERVICES_LINUX_SYSCALLS_H_

#if defined(__x86_64__)
#include "sandbox/linux/services/x86_64_linux_syscalls.h"
#endif

#if defined(__i386__)
#include "sandbox/linux/services/x86_32_linux_syscalls.h"
#endif

#if defined(__arm__) && defined(__ARM_EABI__)
#include "sandbox/linux/services/arm_linux_syscalls.h"
#endif

#if defined(__mips__) && defined(_ABIO32)
#include "sandbox/linux/services/mips_linux_syscalls.h"
#endif

#endif  // SANDBOX_LINUX_SERVICES_LINUX_SYSCALLS_H_

[MIPS] Add ABI check for syscall numbers definitions

In file mips_linux_syscalls.h are definitions of syscall
numbers for O32 ABI, so this check is needed in order for
Mips architectures with other ABIs to work properly.

BUG=400684
TEST=compile sandbox_linux_unittest for MIPS32 and MIPS64

Review URL: https://codereview.chromium.org/446213003

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@288252 0039d316-1c4b-4281-b951-d872f2087c98


#ifndef GRIDINF_INCLUDE_GPUGRID_H
#define GRIDINF_INCLUDE_GPUGRID_H

#include "matdim.h"

namespace ginf {
	// Mirrors the Grid class, but uses an implementation that is more suitable for GPUs.
	template <typename T>
	class GpuGrid {
	public:
		int smModel; // The smoothness cost model
		MatDim dimDt, dimSm; // Dimensions of cost matrices
		T *dtCosts; // Data cost matrix
		T *smCosts; // Smoothness cost matrix

// Declare this functions only when compiling with nvcc
#ifdef __CUDACC__
		// Get width/height
		__device__ int getWidth() {
			return dimDt.x;
		}

		__device__ int getHeight() {
			return dimDt.y;
		}

		// Get total number of nodes
		__device__ int getNumNodes() {
			return dimDt.x * dimDt.y;
		}

		// Get number of labels
		__device__ int getNumLabels() {
			return dimDt.z;
		}

		// Get the cost of labeling (x, y) with label fp
		__device__ T getDataCost(int x, int y, int fp) {
			return dtCosts[dimDt.idx(x, y, fp)];
		}

		// Get the smoothness cost V(fp, fq)
		__device__ T getSmoothnessCost(int fp, int fq) {
			return smCosts[dimSm.idx(fp, fq)];
		}

		// Returns the cost of a labeling for a particular pixel
		__device__ T getLabelingCost(int *f, int x, int y, int label) {
			T totalCost = getDataCost(x, y, label);
			for (int d = 0; d < GINF_NUM_DIR; d++) {
				int nx = x + dDirX[d], ny = y + dDirY[d];
				if (dimDt.isValid(nx, ny)) {
					totalCost += getSmoothnessCost(label, (int)f[dimDt.idx(nx, ny)]);
				}
			}

			return totalCost;
		}
#endif
	};

	// Explicit instantiations for template classes
	template class GpuGrid<int>;
	template class GpuGrid<float>;
}

#endif

Add class for representing a Grid on the device


/* $Id$Revision: */
/* vim:set shiftwidth=4 ts=8: */

/**********************************************************
*      This software is part of the graphviz package      *
*                http://www.graphviz.org/                 *
*                                                         *
*            Copyright (c) 1994-2004 AT&T Corp.           *
*                and is licensed under the                *
*            Common Public License, Version 1.0           *
*                      by AT&T Corp.                      *
*                                                         *
*        Information and Software Systems Research        *
*              AT&T Research, Florham Park NJ             *
**********************************************************/

#ifndef ORTHO_H
#define ORTHO_H
#include <render.h>

void orthoEdges (Agraph_t* g, int useLbls, splineInfo* sinfo);

#endif

/* $Id$Revision: */
/* vim:set shiftwidth=4 ts=8: */

/**********************************************************
*      This software is part of the graphviz package      *
*                http://www.graphviz.org/                 *
*                                                         *
*            Copyright (c) 1994-2004 AT&T Corp.           *
*                and is licensed under the                *
*            Common Public License, Version 1.0           *
*                      by AT&T Corp.                      *
*                                                         *
*        Information and Software Systems Research        *
*              AT&T Research, Florham Park NJ             *
**********************************************************/

#ifndef ORTHO_H
#define ORTHO_H
#include <render.h>

void orthoEdges (Agraph_t* g, int useLbls);

#endif

Add to comments; remove use of sinfo from calling routines; adjust code to play well with other routing functions; add framework for handling loops


//
//  ArticleCellView.h
//  PXListView
//
//  Adapted from PXListView by Alex Rozanski
//  Modified by Barijaona Ramaholimihaso
//

#import <Cocoa/Cocoa.h>

#import "PXListViewCell.h"
#import "ArticleView.h"

@interface ArticleCellView : PXListViewCell
{
	AppController * controller;
	ArticleView *articleView;
	NSProgressIndicator * progressIndicator;
}

@property (nonatomic, retain) ArticleView *articleView;
@property BOOL inProgress;
@property int folderId;

// Public functions
-(id)initWithReusableIdentifier: (NSString*)identifier inFrame:(NSRect)frameRect;
@end

//
//  ArticleCellView.h
//  PXListView
//
//  Adapted from PXListView by Alex Rozanski
//  Modified by Barijaona Ramaholimihaso
//

#import <Cocoa/Cocoa.h>

#import "PXListViewCell.h"
#import "ArticleView.h"

@interface ArticleCellView : PXListViewCell
{
	AppController * controller;
	ArticleView *articleView;
	NSProgressIndicator * progressIndicator;
	BOOL inProgress;
	int folderId;
}

@property (nonatomic, retain) ArticleView *articleView;
@property BOOL inProgress;
@property int folderId;

// Public functions
-(id)initWithReusableIdentifier: (NSString*)identifier inFrame:(NSRect)frameRect;
@end

Fix a static analyzer error

Fix a static analyzer error


/*
 * $Id$
 *
 * Define the tags in the shared memory in a reusable format.
 * Whoever includes this get to define what the SLTM macro does.
 *
 */

SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(URL)
SLTM(Protocol)
SLTM(Headers)

/*
 * $Id$
 *
 * Define the tags in the shared memory in a reusable format.
 * Whoever includes this get to define what the SLTM macro does.
 *
 */

SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(URL)
SLTM(Protocol)
SLTM(H_Unknown)
#define HTTPH(a, b)	SLTM(b)
#include "http_headers.h"
#undef HTTPH

Use http_headers.h to define HTTP header tags for logging

git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@90 d4fa192b-c00b-0410-8231-f00ffab90ce4


#define _MASTERCOILS

#include <inttypes.h>

//Functions for building requests
extern uint8_t MODBUSBuildRequest01( uint8_t, uint16_t, uint16_t );
extern uint8_t MODBUSBuildRequest05( uint8_t, uint16_t, uint16_t );
extern uint8_t MODBUSBuildRequest15( uint8_t, uint16_t, uint16_t, uint8_t * );

//Functions for parsing responses
extern void MODBUSParseResponse01( union MODBUSParser *, union MODBUSParser * );
//extern void MODBUSParseResponse05( union MODBUSParser *, union MODBUSParser * );
//extern void MODBUSParseResponse15( union MODBUSParser *, union MODBUSParser * );

#define _MASTERCOILS

#include <inttypes.h>

//Functions for building requests
extern uint8_t MODBUSBuildRequest01( uint8_t, uint16_t, uint16_t );
extern uint8_t MODBUSBuildRequest05( uint8_t, uint16_t, uint16_t );
extern uint8_t MODBUSBuildRequest15( uint8_t, uint16_t, uint16_t, uint8_t * );

//Functions for parsing responses
extern void MODBUSParseResponse01( union MODBUSParser *, union MODBUSParser * );
extern void MODBUSParseResponse05( union MODBUSParser *, union MODBUSParser * );
extern void MODBUSParseResponse15( union MODBUSParser *, union MODBUSParser * );

Add prototypes for functions for parsing slave's responses


#include <unordered_set>
#include "../src/include/gc_obj.h"
#include "../src/include/collector.h"

class BinaryTreeNode : public gc_obj {
public:
	BinaryTreeNode(const int id);
	~BinaryTreeNode() = delete;
	int size() const;
	void curtailToLevel(const int lvl);
	void extendToLevel(const int size,Collector* collector);
	void addLeftChild(BinaryTreeNode* leftChild);
	void addRightChild(BinaryTreeNode* rightChild);
	virtual void finalize();
	virtual std::unordered_set<gc_obj*> getManagedChildren();
private:
	int id;
	BinaryTreeNode* leftChild;
	BinaryTreeNode* rightChild;
};

#include <unordered_set>
#include "../src/include/gc_obj.h"

class BinaryTreeNode : public gc_obj {
public:
	BinaryTreeNode(const int id);
	int size() const;
	void curtailToLevel(const int lvl);
	void extendToLevel(const int size);
	void addLeftChild(BinaryTreeNode* leftChild);
	void addRightChild(BinaryTreeNode* rightChild);
	virtual void finalize();
	virtual std::unordered_set<gc_obj*> getManagedChildren();
private:
	int id;
	BinaryTreeNode* leftChild;
	BinaryTreeNode* rightChild;
};

Remove manual addObject usage from the collector


//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2009      Bastian Holst <bastianholst@gmx.de>
//

#ifndef BBCWEATHERITEM_H
#define BBCWEATHERITEM_H

#include "WeatherItem.h"

class QString;
class QUrl;

namespace Marble
{

class BBCWeatherItem : public WeatherItem
{
 public:
    BBCWeatherItem( QObject *parent = 0 );
    ~BBCWeatherItem();

    virtual bool request( const QString& type );

    QString service() const;
    void addDownloadedFile( const QString& url, const QString& type );

    QUrl observationUrl() const;
    QUrl forecastUrl() const;

    quint32 bbcId() const;
    void setBbcId( quint32 id );

    QString creditHtml() const;
 private:
    quint32 m_bbcId;
    bool m_observationRequested;
    bool m_forecastRequested;
};

} // namespace Marble

#endif // BBCWEATHERITEM_H

//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2009      Bastian Holst <bastianholst@gmx.de>
//

#ifndef BBCWEATHERITEM_H
#define BBCWEATHERITEM_H

#include "WeatherItem.h"

class QString;
class QUrl;

namespace Marble
{

class BBCWeatherItem : public WeatherItem
{
    Q_OBJECT

 public:
    BBCWeatherItem( QObject *parent = 0 );
    ~BBCWeatherItem();

    virtual bool request( const QString& type );

    QString service() const;
    void addDownloadedFile( const QString& url, const QString& type );

    QUrl observationUrl() const;
    QUrl forecastUrl() const;

    quint32 bbcId() const;
    void setBbcId( quint32 id );

    QString creditHtml() const;
 private:
    quint32 m_bbcId;
    bool m_observationRequested;
    bool m_forecastRequested;
};

} // namespace Marble

#endif // BBCWEATHERITEM_H

Add Q_OBJECT macro (requested by lupdate).

svn path=/trunk/KDE/kdeedu/marble/; revision=1205732


#include "message-processor.h"

class UrlFilter : public AbstractMessageFilter
{
    virtual void filterMessage(Message& message);
};

class ImageFilter : public AbstractMessageFilter
{
    virtual void filterMessage(Message& message);
};

class EmoticonFilter : public AbstractMessageFilter
{
    virtual void filterMessage(Message& message);
};

Create headers for ImageFilter and EmoticonFilter


#ifndef SSPAPPLICATION_DEBUG_DEBUGHANDLER_H
#define SSPAPPLICATION_DEBUG_DEBUGHANDLER_H

#include <vector>
#include <iostream>
#include <Windows.h>

class DebugHandler
{
private:
	std::vector<LARGE_INTEGER> m_timers;
	std::vector<std::string> m_labels;
	std::vector<unsigned short int> m_timerMins;
	std::vector<unsigned short int> m_timerMaxs;
	std::vector<float> m_customValues;
	unsigned short int m_lastFPS[10];
	unsigned short int m_lastFPSCurr;

public:
	DebugHandler();
	~DebugHandler();

	int StartTimer(std::string label); //returns timer ID, -1 fail
	int EndTimer();
	int EndTimer(int timerID);

	int StartProgram();
	int EndProgram();
	int ShowFPS(bool show);

	int CreateCustomLabel(std::string label, float value); //returns label ID, -1 fail
	int UpdateCustomLabel(int labelID, float newValue);

	int Display();
};

#endif

#ifndef SSPAPPLICATION_DEBUG_DEBUGHANDLER_H
#define SSPAPPLICATION_DEBUG_DEBUGHANDLER_H

#include <vector>
#include <iostream>
#include <Windows.h>

class DebugHandler
{
private:
	std::vector<LARGE_INTEGER> m_timers;
	std::vector<std::string> m_labels;
	std::vector<unsigned short int> m_timerMins;
	std::vector<unsigned short int> m_timerMaxs;
	std::vector<float> m_customValues;
	unsigned short int m_frameTimes[10];
	unsigned short int m_currFrameTimesPtr;

public:
	DebugHandler();
	~DebugHandler();

	int StartTimer(std::string label); //returns timer ID, -1 fail
	int EndTimer();
	int EndTimer(int timerID);

	int StartProgram();
	int EndProgram();
	int ShowFPS(bool show);

	int CreateCustomLabel(std::string label, float value); //returns label ID, -1 fail
	int UpdateCustomLabel(int labelID, float newValue);

	int Display();
};

#endif

UPDATE some variable name changes

UPDATE some variable name changes


#include <string.h>
#include "proxrcmds.h"
#include "sim-hab.h"

void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value)
{
    uint8_t data;
    float content;
    int id;
    bionet_node_t *node;

    bionet_value_get_uint8(value, &data);
    if(data < 0 || data > 255)
	return;

    node = bionet_resource_get_node(resource);
    // get index of resource
    //FIXME: probably a better way to do this
    for(int i=0; i<16; i++)
    {
        char buf[5];
        char name[24];
        strcpy(name, "Potentiometer\0");
        sprintf(buf,"%d", i);
        int len = strlen(buf);
        buf[len] = '\0';
        strcat(name, buf);

        if(bionet_resource_matches_id(resource, name))
        {
            id = i;
            break;
        }
    }
    // command proxr to adjust to new value
    set_potentiometer(id, data);
    // set resources datapoint to new value
    content = data*POT_CONVERSION;
    bionet_resource_set_float(resource, content, NULL);
    hab_report_datapoints(node);
}

#include <string.h>
#include "proxrcmds.h"
#include "sim-hab.h"

void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value)
{
    float data;
    float content;
    int id;
    bionet_node_t *node;

    bionet_value_get_float(value, &data);
    if(data < 0 || data > 255)
	return;

    node = bionet_resource_get_node(resource);
    // get index of resource
    //FIXME: probably a better way to do this
    for(int i=0; i<16; i++)
    {
        char buf[5];
        char name[24];
        strcpy(name, "Potentiometer\0");
        sprintf(buf,"%d", i);
        int len = strlen(buf);
        buf[len] = '\0';
        strcat(name, buf);

        if(bionet_resource_matches_id(resource, name))
        {
            id = i;
            break;
        }
    }
    // command proxr to adjust to new value
    set_potentiometer(id, (int)data);
    // set resources datapoint to new value
    content = data*POT_CONVERSION;
    bionet_resource_set_float(resource, content, NULL);
    hab_report_datapoints(node);
}

Modify set resource. Using floats now.

Modify set resource. Using floats now.


#ifndef _ASM_IA64_RESOURCE_H
#define _ASM_IA64_RESOURCE_H

#include <asm/ustack.h>
#define _STK_LIM_MAX	DEFAULT_USER_STACK_SIZE
#include <asm-generic/resource.h>

#endif /* _ASM_IA64_RESOURCE_H */

#ifndef _ASM_IA64_RESOURCE_H
#define _ASM_IA64_RESOURCE_H

#include <asm/ustack.h>
#include <asm-generic/resource.h>

#endif /* _ASM_IA64_RESOURCE_H */

Remove stack hard limit on ia64

[IA64] Remove stack hard limit on ia64

Un-Breaks pthreads, since Oct 2003.

Signed-off-by: Olaf Hering <ded022db89399a060a39da31922f173c6556c2d9@aepfle.de>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Tony Luck <e7984595ec0368ff920a7b3521dc7093683f6f26@intel.com>


//
//  str_util.h
//  int2eng
//
//  Created by Rodrigo Fontes on 17/12/16.
//  Copyright © 2016 Rodrigo Fontes. All rights reserved.
//

#ifndef str_util_h
#define str_util_h

#endif /* str_util_h */

Add header file with useful string functions


#pragma once

#include <Windows.h>
#include <functional>
#include <string>

class Control {
public:
    Control();
    Control(int id, HWND parent);
    ~Control();

    virtual RECT Dimensions();

    virtual void Enable();
    virtual void Disable();
    virtual bool Enabled();
    virtual void Enabled(bool enabled);

    virtual std::wstring Text();
    virtual int TextAsInt();
    virtual bool Text(std::wstring text);
    virtual bool Text(int value);

    void WindowExStyle();
    void WindowExStyle(long exStyle);
    void AddWindowExStyle(long exStyle);
    void RemoveWindowExStyle(long exStyle);

    /// Handles WM_COMMAND messages.
    /// <param name="nCode">Control-defined notification code</param>
    virtual DLGPROC Command(unsigned short nCode);

    /// Handles WM_NOTIFY messages.
    /// <param name="nHdr">Notification header structure</param>
    virtual DLGPROC Notification(NMHDR *nHdr);

protected:
    int _id;
    HWND _hWnd;
    HWND _parent;

protected:
    static const int MAX_EDITSTR = 0x4000;
};

#pragma once

#include <Windows.h>
#include <functional>
#include <string>

class Control {
public:
    Control();
    Control(int id, HWND parent);
    ~Control();

    virtual RECT Dimensions();

    virtual void Enable();
    virtual void Disable();
    virtual bool Enabled();
    virtual void Enabled(bool enabled);

    virtual std::wstring Text();
    virtual int TextAsInt();
    virtual bool Text(std::wstring text);
    virtual bool Text(int value);

    void WindowExStyle();
    void WindowExStyle(long exStyle);
    void AddWindowExStyle(long exStyle);
    void RemoveWindowExStyle(long exStyle);

    /// Handles WM_COMMAND messages.
    /// <param name="nCode">Control-defined notification code</param>
    virtual DLGPROC Command(unsigned short nCode);

    /// Handles WM_NOTIFY messages.
    /// <param name="nHdr">Notification header structure</param>
    virtual DLGPROC Notification(NMHDR *nHdr);

protected:
    int _id;
    HWND _hWnd;
    HWND _parent;

protected:
    static const int MAX_EDITSTR = 4096;
};

Decrease MAX_EDITSTR. Was way too big.

Decrease MAX_EDITSTR. Was way too big.


/*
 * libtu/util.h
 *
 * Copyright (c) Tuomo Valkonen 1999-2002.
 *
 * You may distribute and modify this library under the terms of either
 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
 */

#ifndef LIBTU_UTIL_H
#define LIBTU_UTIL_H

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

#include "types.h"
#include "optparser.h"

extern void libtu_init(const char *argv0);
extern const char *libtu_progname();
extern const char *libtu_progbasename();

#endif /* LIBTU_UTIL_H */

/*
 * libtu/util.h
 *
 * Copyright (c) Tuomo Valkonen 1999-2002.
 *
 * You may distribute and modify this library under the terms of either
 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
 */

#ifndef LIBTU_UTIL_H
#define LIBTU_UTIL_H

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

#include "types.h"
#include "optparser.h"

/**
 * @parame argv0 The program name used to invoke the current program, with
 * path (if specified). Unfortunately it is generally not easy to determine
 * the encoding of this string, so we don't require a specific one here.
 *
 * @see http://stackoverflow.com/questions/5408730/what-is-the-encoding-of-argv
 */
extern void libtu_init(const char *argv0);
/**
 * The program name used to invoke the current program, with path (if
 * supplied). Unfortunately the encoding is undefined.
 */
extern const char *libtu_progname();
/**
 * The program name used to invoke the current program, without path.
 * Unfortunately the encoding is undefined.
 */
extern const char *libtu_progbasename();

#endif /* LIBTU_UTIL_H */

Document (lack of) character encoding rules in the API