#ifndef _FAKE_LOCK_SCREEN_PATTERN_H_
#define _FAKE_LOCK_SCREEN_PATTERN_H_

#include <gtk/gtk.h>

#if !GTK_CHECK_VERSION(3, 0, 0)
typedef struct {
  gdouble red;
  gdouble green;
  gdouble blue;
  gdouble alpha;
} GdkRGBA;
#endif

typedef struct _FakeLockOption {
  void *module;
  gchar *real;
  gchar *dummy;
} FakeLockOption;

typedef struct {
  gboolean marked;
  gint value;
  GdkPoint top_left;
  GdkPoint bottom_right;
} FakeLockPatternPoint;

void flsp_draw_circle(cairo_t *context,
                      gint x, gint y, gint radius,
                      GdkRGBA circle, GdkRGBA border);

gboolean is_marked(gint x, gint y,
                   gint *marked, void *user_data);

#endif

#ifndef _FAKE_LOCK_SCREEN_PATTERN_H_
#define _FAKE_LOCK_SCREEN_PATTERN_H_

#include <gtk/gtk.h>

#if !GTK_CHECK_VERSION(3, 0, 0)
typedef struct {
  gdouble red;
  gdouble green;
  gdouble blue;
  gdouble alpha;
} GdkRGBA;
#endif

typedef struct _FakeLockOption {
  void *module;
  gchar *real;
  gchar *dummy;
} FakeLockOption;

typedef struct {
  gboolean marked;
  gint value;
  GdkPoint top_left;
  GdkPoint bottom_right;
} FakeLockPatternPoint;

typedef enum {
  FLSP_ONE_STROKE,
  FLSP_ON_BOARD,
  FLSP_N_PATTERN,
} FakeLockScreenPattern;

void flsp_draw_circle(cairo_t *context,
                      gint x, gint y, gint radius,
                      GdkRGBA circle, GdkRGBA border);

gboolean is_marked(gint x, gint y,
                   gint *marked, void *user_data);

#endif

Add enum to distinct pattern

Add enum to distinct pattern


/* This is the prototype for the strdup() function which is distributed
   with Postgres.  That strdup() is only needed on those systems that
   don't already have strdup() in their system libraries.

   The Postgres strdup() is in src/utils/strdup.c.
*/

extern char *strdup(char const *);

/* This is the prototype for the strdup() function which is distributed
   with Postgres.  That strdup() is only needed on those systems that
   don't already have strdup() in their system libraries.

   The Postgres strdup() is in src/port/strdup.c.
*/

extern char *strdup(char const *);

Fix an obsolete file path mentioned in a comment.


#include <truth/panic.h>
#include <truth/cpu.h>
#include <truth/types.h>
#include <truth/log.h>
#include <truth/slab.h>
#include <truth/heap.h>
#include <truth/physical_allocator.h>

string Logo = str("\n"
                  "            _.-.\n"
                  "        .-.  `) |  .-.\n"
                  "    _.'`. .~./  \\.~. .`'._\n"
                  " .-' .'.'.'.-|  |-.'.'.'. '-.\n"
                  "  `'`'`'`'`  \\  /  `'`'`'`'`\n"
                  "             /||\\\n"
                  "            //||\\\\\n"
                  "\n"
                  "      The Kernel of Truth\n");

void kernel_main(void *multiboot_tables) {
    enum status status = init_log("log");
    assert(status == Ok);
    log(Logo);
    logf("\tVersion %d.%d.%d\n\tCommit %s\n\t%s\n",
         kernel_major, kernel_minor, kernel_patch, vcs_version,
         project_website);
    init_interrupts();
    init_physical_allocator(multiboot_tables);
    init_slab();
    status = init_heap();
    assert(status == Ok);
    halt();
}

#include <truth/panic.h>
#include <truth/cpu.h>
#include <truth/types.h>
#include <truth/log.h>
#include <truth/slab.h>
#include <truth/heap.h>
#include <truth/physical_allocator.h>

string Logo = str("\n"
                  "            _.-.\n"
                  "        .-.  `) |  .-.\n"
                  "    _.'`. .~./  \\.~. .`'._\n"
                  " .-' .'.'.'.-|  |-.'.'.'. '-.\n"
                  "  `'`'`'`'`  \\  /  `'`'`'`'`\n"
                  "             /||\\\n"
                  "            //||\\\\\n"
                  "\n"
                  "      The Kernel of Truth\n");

void kernel_main(void *multiboot_tables) {
    enum status status = init_log("log");
    assert(status == Ok);
    log(Logo);
    logf("\tVersion %d.%d.%d\n\tCommit %s\n\t%s\n\tCPU Time %ld\n",
         kernel_major, kernel_minor, kernel_patch, vcs_version,
         project_website, cpu_time());
    init_interrupts();
    init_physical_allocator(multiboot_tables);
    init_slab();
    status = init_heap();
    assert(status == Ok);
    halt();
}

Print CPU time in splash screen

Print CPU time in splash screen


// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

// Multiply-included file, no traditional include guard.

#include "atom/common/api/api_messages.h"
#include "chrome/common/print_messages.h"
#include "chrome/common/tts_messages.h"
#include "chrome/common/widevine_cdm_messages.h"
#include "chrome/common/chrome_utility_messages.h"

Fix linking problem with IPC::MessageT

Fix linking problem with IPC::MessageT

IPC::MessageT<ChromeUtilityHostMsg_ProcessStarted_Meta, std::__1::tuple<>, void>::MessageT(IPC::Routing)


speciﬁc action log: newIssueGroup
#
Set Variable [ $brainstate; Value:brainstate::_lockBrainstateID ]
#
Go to Layout [ “IssuesAndObservations Copy” (issue) ]
#
New Record/Request
Set Field [ issue::lock; "location" ]
Set Field [ issue::_keyBrainstate; $brainstate ]
#
Set Variable [ $group; Value:issue::_LockList ]
#
Go to Layout [ original layout ]
#
Go to Object [ Object Name: "group" ]
#
Go to Portal Row
[ First ]
Loop
Exit Loop If [ $group = category::_LockList ]
Go to Portal Row
[ Select; Next ]
End Loop
#
Go to Field [ category::text ]
January 6, 平成26 11:15:58 ActionLog.fp7 - newIssueGroup -1-

speciﬁc action log: newIssueGroup
#
Set Variable [ $brainstate; Value:brainstate::_lockBrainstateID ]
#
Go to Layout [ “IssuesAndObservations Copy” (issue) ]
#
New Record/Request
Set Field [ issue::lock; "location" ]
Set Field [ issue::_keyBrainstate; $brainstate ]
#
Set Variable [ $group; Value:issue::_LockList ]
#
Go to Layout [ original layout ]
#
Go to Object [ Object Name: "group" ]
#
Go to Portal Row
[ First ]
Loop
Exit Loop If [ $group = category::_LockList ]
Go to Portal Row
[ Select; Next; Exit after last ]
End Loop
#
Go to Field [ category::text ]
February 24, 平成26 15:13:03 ActionLog.fp7 - newIssueGroup -1-

Fix logic loop in script

Fix logic loop in script

Fix logic loop in script attached to button [Specific Action Tag 47] so
it exists after reaching last item.


// RUN: %llvmgcc -S -march=armv7a %s

// XFAIL: *
// XTARGET: arm

int t1() {
  static float k = 1.0f;
CHECK: call void asm sideeffect "flds s15, $0 \0A", "*^Uv,~{s15}"
  __asm__ volatile ("flds s15, %[k] \n" :: [k] "Uv,m" (k) : "s15");
  return 0;
}

// RUN: %llvmgcc -S -march=armv7a %s | FileCheck %s

// XFAIL: *
// XTARGET: arm

int t1() {
  static float k = 1.0f;
  // CHECK: "flds s15, $0 \0A", "*^Uv,~{s15}"
  __asm__ volatile ("flds s15, %[k] \n" :: [k] "Uv,m" (k) : "s15");
  return 0;
}

Fix this test to actually check something and be able to be compiled.

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


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

#include "crypt.h"
#include "accessdata.h"
#include "vars.h"

static char fileName[] = "ruleDB.dsg";

void main()
{
	// struct staticVar svar;
	struct staticVar *p;

	p = malloc(sizeof(struct staticVar));
	// p = &svar;

	// strcpy(svar.s1, "Sarat");
	// svar.s2 = 10;
	// svar.s3 = 16.5;
	// strcpy(svar.s4, "Mahesh");
	// svar.s5 = 1234567.67;
	// strcpy(svar.s6, "Y");
	// svar.s7 = 143.23;
	// svar.s8.varId = 10;
	// strcpy(svar.s8.varData,"Inside a structure.");

	FILE * fp;

	// fp = fopen (fileName, "w+");
	fp = fopen (fileName, "r+");
	// fwrite(p,sizeof(struct staticVar),1,fp);
	fread(p,sizeof(struct staticVar),1,fp);

	printf("%s \n", p->s4);

	fclose(fp);
}

Read data from Static File

Read data from Static File

Reading data from static file and then displaying the data using pointers


#ifndef COMPAT_H
#define COMPAT_H

#ifndef HAVE_PLEDGE
#include "pledge.h"
#endif

#ifndef HAVE_STRTONUM
#include "strtonum.h"
#endif

#ifndef timespecsub
#define	timespecsub(tsp, usp, vsp)					\
	do {								\
		(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec;		\
		(vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec;	\
		if ((vsp)->tv_nsec < 0) {				\
			(vsp)->tv_sec--;				\
			(vsp)->tv_nsec += 1000000000L;			\
		}							\
	} while (0)
#endif

#endif /* COMPAT_H */

#ifndef COMPAT_H
#define COMPAT_H

#ifndef HAVE_PLEDGE
#include "pledge.h"
#endif

#ifndef HAVE_STRTONUM
#include "strtonum.h"
#endif

/* Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available */
#ifndef CLOCK_MONOTONIC
#define CLOCK_MONOTONIC CLOCK_REALTIME
#endif

#ifndef timespecsub
#define	timespecsub(tsp, usp, vsp)					\
	do {								\
		(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec;		\
		(vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec;	\
		if ((vsp)->tv_nsec < 0) {				\
			(vsp)->tv_sec--;				\
			(vsp)->tv_nsec += 1000000000L;			\
		}							\
	} while (0)
#endif

#endif /* COMPAT_H */

Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available.


/* Exercise 1-15: Rewrite the temperature conversion program of Section 1.2 to
 * use a function for conversion. */

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

float farenheitToCelsius(float farenheit)
{
	return (5.0 / 9.0) * (farenheit - 32.0);
}

int main(int argc, char **argv)
{
  printf("F\tC\n=============\n");
  float i;
  for (i = 0; i <= 300; i += 20) {
    printf("%3.0f\t%5.1f\n", i, farenheitToCelsius(i));
  }
  return EXIT_SUCCESS;
}

Add solution to Exercise 1-15.

Add solution to Exercise 1-15.


/*
Copyright © 2018-2019 Atlas Engineer LLC.
Use of this file is governed by the license that can be found in LICENSE.
*/

#include <gtk/gtk.h>
#include <stdlib.h>
#include "server.h"

static void on_name_acquired(GDBusConnection *connection,
	const gchar *name,
	gpointer user_data) {
	g_message("Starting platform port");
}

static void on_name_lost(GDBusConnection *_connection,
	const gchar *_name,
	gpointer _user_data) {
	g_message("Platform port disconnected");
	// TODO: Call stop_server here?
	exit(1);
}

int main(int argc, char *argv[]) {
	// TODO: Use GtkApplication?
	guint owner_id = g_bus_own_name(G_BUS_TYPE_SESSION,
			PLATFORM_PORT_NAME,
			G_BUS_NAME_OWNER_FLAGS_NONE,
			start_server,
			on_name_acquired,
			on_name_lost,
			NULL,
			NULL);

	// TODO: Start the RPC server first?  If GUI is started, then we can
	// report RPC startup issues graphically.

	gtk_main();

	stop_server();

	g_bus_unown_name(owner_id);
	return EXIT_SUCCESS;
}

/*
Copyright © 2018-2019 Atlas Engineer LLC.
Use of this file is governed by the license that can be found in LICENSE.
*/

#include <gtk/gtk.h>
#include <stdlib.h>
#include "server.h"

static void on_name_acquired(GDBusConnection *connection,
	const gchar *name,
	gpointer user_data) {
	g_message("Starting platform port");
}

static void on_name_lost(GDBusConnection *_connection,
	const gchar *_name,
	gpointer _user_data) {
	g_message("Platform port disconnected");
	// TODO: Call stop_server here?
	exit(1);
}

int main(int argc, char *argv[]) {
	// It's safer to initialize GTK before the server is started.  In particular,
	// without it the program would crash if hardware acceleration is disabled
	// (e.g. with the WEBKIT_DISABLE_COMPOSITING_MODE=1 environment variable).
	gtk_init(NULL, NULL);
	// TODO: Use GtkApplication?

	guint owner_id = g_bus_own_name(G_BUS_TYPE_SESSION,
			PLATFORM_PORT_NAME,
			G_BUS_NAME_OWNER_FLAGS_NONE,
			start_server,
			on_name_acquired,
			on_name_lost,
			NULL,
			NULL);

	// TODO: Start the RPC server first?  If GUI is started, then we can
	// report RPC startup issues graphically.

	gtk_main();

	stop_server();

	g_bus_unown_name(owner_id);
	return EXIT_SUCCESS;
}

ports/gtk-webkit: Fix crash when hardware acceleration is disabled.


#include <stdio.h>
#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;

/*
 * Here's the routine that will replace the standard error_exit method:
 */

void error_exit (j_common_ptr cinfo)
{
  /* cinfo->err really points to a error_mgr2 struct, so coerce pointer */
  error_ptr2 myerr = (error_ptr2) cinfo->err;

  /* Return control to the setjmp point */
  longjmp(myerr->setjmp_buffer, 1);
}

Remove nasty character at end of file that prevents compiles

git-svn-id: 5c8b60fcb9320cccfd2f497bdea85b37ac3f2028@72 fa1542d4-bde8-0310-ad64-8ed1123d492a


//
// Created by Michael Kuck on 8/20/14.
// Copyright (c) 2014 Michael Kuck. All rights reserved.
//

#import <Foundation/Foundation.h>

//============================================================
//== MKUITheme protocol
//============================================================
@protocol MKUIThemeProtocol<NSObject>

+ (UIColor *)lightThemeColor;
+ (UIColor *)normalThemeColor;
+ (UIColor *)darkThemeColor;

+ (UIStatusBarStyle)statusBarStyle;

+ (UIColor *)navigationBarContentColor;

+ (void)configureApplication;

@end

//
// Created by Michael Kuck on 8/20/14.
// Copyright (c) 2014 Michael Kuck. All rights reserved.
//

#import <Foundation/Foundation.h>

//============================================================
//== MKUITheme protocol
//============================================================
@protocol MKUIThemeProtocol<NSObject>

+ (UIColor *)lightThemeColor;
+ (UIColor *)normalThemeColor;
+ (UIColor *)darkThemeColor;

+ (UIStatusBarStyle)statusBarStyle;

+ (UIColor *)navigationBarContentColor;

+ (CGFloat)bigViewPadding;
+ (CGFloat)defaultViewPadding;

+ (void)configureApplication;

@end

Extend UIThemeProtocol with padding/inset sizes


#pragma once

#include <algorithm>
#include <unordered_map>
#include <utility>
#include <vector>

/**
 * Given a list of edges describing a directed acyclic graph, returns a
 * list of nodes sorted in topological order; that is, if there is a path
 * from node 'a' to node 'b' in the graph, then 'a' will always precede
 * 'b' in the sorted result.
 */
template<typename T>
std::vector<T> topologicalSort(std::vector<std::pair<T, T>> edges) {

    // Produce a sorted list of nodes using Kahn's algorithm.
    std::vector<T> sorted;

    // Loop over input edges, counting the incoming edges for each node.
    std::unordered_map<T, size_t> incoming_edges;
    for (const auto& edge : edges) {
        incoming_edges[edge.first];
        ++incoming_edges[edge.second];
    }

    // Find the set of starting nodes that have no incoming edges.
    std::vector<T> start_nodes;
    for (const auto& node : incoming_edges) {
        if (node.second == 0) {
            start_nodes.push_back(node.first);
        }
    }

    while (!start_nodes.empty()) {
        // Choose a node 'n' from the set of starting nodes and remove it.
        auto n = start_nodes.back();
        start_nodes.pop_back();

        // Add the value of 'n' to the sorted list.
        sorted.push_back(n);

        // For each node 'm' with an edge 'e' from 'n' to 'm' ...
        for (auto it = edges.begin(); it != edges.end(); ) {
            auto e = *it;
            if (e.first == n) {
                auto m = e.second;
                // ... remove edge 'e' from the graph.
                it = edges.erase(it);
                // If 'm' has no more incoming edges,
                // add it to the set of starting nodes.
                if (--incoming_edges[m] == 0) {
                    start_nodes.push_back(m);
                }
            } else {
                ++it;
            }
        }
    }

    if (!edges.empty()) {
        // Graph has cycles! This is an error.
        return {};
    }

    return sorted;

}

Add a topological sort utility file

Add a topological sort utility file


#include "flags.h"

#include <stdio.h>

#include "laco.h"
#include "util.h"

static const char* version_matches[] = {"-v", "--version", NULL};
static const char* help_matches[]    = {"-h", "--help", NULL};

/* Print off the current version of laco */
static void handle_version(LacoState* laco, const char** arguments) {
  const char* version = laco_get_laco_version(laco);

  printf("laco version %s\n", version);
  laco_kill(laco, 0, NULL);
}

/* Print off the help screen */
static void handle_help(LacoState* laco, const char** arguments) {
  puts("A better REPL for Lua.\n");
  puts("Usage: laco [options]\n");
  puts("-h | --help     Print this help screen");
  puts("-v | --version  Print current version");

  laco_kill(laco, 0, NULL);
}

static const LacoCommand flag_commands[] = {
  { version_matches, handle_version },
  { help_matches,    handle_help },
  { NULL, NULL }
};

/* External API */

void laco_handle_flag(LacoState* laco) {
  const char* command = laco_get_laco_args(laco)[1];

  laco_dispatch(flag_commands, laco, command, NULL);
}

#include "flags.h"

#include <stdio.h>

#include "laco.h"
#include "util.h"

static const char* version_matches[] = {"-v", "--version", NULL};
static const char* help_matches[]    = {"-h", "--help", NULL};

/* Print off the current version of laco */
static void handle_version(LacoState* laco, const char** arguments) {
  const char* version = laco_get_laco_version(laco);

  printf("laco version %s\n", version);
  laco_kill(laco, 0, NULL);
}

/* Print off the help screen */
static void handle_help(LacoState* laco, const char** arguments) {
  puts("A better REPL for Lua.\n");
  puts("Usage: laco [options]\n");
  puts("-h, --help     Print this help screen");
  puts("-v, --version  Print current version");

  laco_kill(laco, 0, NULL);
}

static const LacoCommand flag_commands[] = {
  { version_matches, handle_version },
  { help_matches,    handle_help },
  { NULL, NULL }
};

/* External API */

void laco_handle_flag(LacoState* laco) {
  const char* command = laco_get_laco_args(laco)[1];

  laco_dispatch(flag_commands, laco, command, NULL);
}

Change flag separation from `|` to `,`

Change flag separation from `|` to `,`


// RUN: clang-cc -emit-pch -o %t --relocatable-pch -isysroot `pwd`/libroot `pwd`/libroot/usr/include/reloc.h &&
// RUN: clang-cc -include-pch %t -isysroot `pwd`/libroot %s -verify
// FIXME (test harness can't do this?): not clang-cc -include-pch %t %s

#include <reloc.h>

int x = 2; // expected-error{{redefinition}}
int y = 5; // expected-error{{redefinition}}

// expected-note{{previous definition}}
// expected-note{{previous definition}}

// RUN: clang-cc -emit-pch -o %t --relocatable-pch -isysroot %S/libroot %S/libroot/usr/include/reloc.h &&
// RUN: clang-cc -include-pch %t -isysroot %S/libroot %s -verify &&
// RUN: not clang-cc -include-pch %t %s

#include <reloc.h>

int x = 2; // expected-error{{redefinition}}
int y = 5; // expected-error{{redefinition}}

// expected-note{{previous definition}}
// expected-note{{previous definition}}

Use %S, not `pwd`, and enable a line that *does* work.
 - Doug, please check.

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


/**
 * test-non-bopomofo-IM.c
 *
 * Copyright (c) 2013
 *      libchewing Core Team. See ChangeLog for details.
 *
 * See the file "COPYING" for information on usage and redistribution
 * of this file.
 */
/**
 * @file test-non-bopomofo-IM.c
 * @brief Test cases of newly built APIs for non-phonetic IM's.
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

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

#include "chewing.h"
#include "testhelper.h"

Add a file to contain test cases for non-phonetic IM's.


#include <stdio.h>
#include <ctype.h>

static void
printstr(FILE *stream, const char *str)
{
    char c;

    while ((c = *str++) != '\0') {
        putc(c, stream);
        if (isprint(c) && c != '"' && c != '\\')
            putc(c, stream);
        else
            fprintf(stream, "\\x%x", (int) c);
    }
}

int main() {
    printstr(stdout, "heisann!\n");
    return 0;
}

Add string function to test suite

Add string function to test suite

Taken from string.c.


#ifndef _ZCCONSTANTS_H_
#define _ZCCONSTANTS_H_

#define ZC_NUM_JS_INPUTS 2
#define ZC_NUM_JS_OUTPUTS 2
#define INCREMENTAL_MERKLE_TREE_DEPTH 20
#define INCREMENTAL_MERKLE_TREE_DEPTH_TESTING 4

#define ZC_NOTEPLAINTEXT_LEADING 1
#define ZC_V_SIZE 8
#define ZC_RHO_SIZE 32
#define ZC_R_SIZE 32
#define ZC_MEMO_SIZE 128

#define ZKSNARK_PROOF_SIZE 584

#endif // _ZCCONSTANTS_H_

#ifndef _ZCCONSTANTS_H_
#define _ZCCONSTANTS_H_

#define ZC_NUM_JS_INPUTS 2
#define ZC_NUM_JS_OUTPUTS 2
#define INCREMENTAL_MERKLE_TREE_DEPTH 29
#define INCREMENTAL_MERKLE_TREE_DEPTH_TESTING 4

#define ZC_NOTEPLAINTEXT_LEADING 1
#define ZC_V_SIZE 8
#define ZC_RHO_SIZE 32
#define ZC_R_SIZE 32
#define ZC_MEMO_SIZE 128

#define ZKSNARK_PROOF_SIZE 584

#endif // _ZCCONSTANTS_H_

Change merkle tree depth to 29.

Change merkle tree depth to 29.


// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

// This file is generated by script/bootstrap.py, you should never modify it
// by hand.

#ifndef ATOM_COMMON_CHROME_VERSION_H_
#define ATOM_COMMON_CHROME_VERSION_H_

#define CHROME_VERSION_STRING "62.0.3202.94"
#define CHROME_VERSION "v" CHROME_VERSION_STRING

#endif  // ATOM_COMMON_CHROME_VERSION_H_

// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

// This file is generated by script/bootstrap.py, you should never modify it
// by hand.

#ifndef ATOM_COMMON_CHROME_VERSION_H_
#define ATOM_COMMON_CHROME_VERSION_H_

#define CHROME_VERSION_STRING "63.0.3239.84"
#define CHROME_VERSION "v" CHROME_VERSION_STRING

#endif  // ATOM_COMMON_CHROME_VERSION_H_

Update Chrome version to 63.0.3239.84

Update Chrome version to 63.0.3239.84


/*
 * screenmsg - Print a message to terminal
 *
 * Written in 2012 by Prashant P Shah <pshah.mumbai@gmail.com>
 *
 * To the extent possible under law, the author(s) have dedicated
 * all copyright and related and neighboring rights to this software
 * to the public domain worldwide. This software is distributed
 * without any warranty.
 *
 * You should have received a copy of the CC0 Public Domain Dedication
 * along with this software.
 * If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
 */

#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[])
{
	char *msg = "Hello world from assembly\n";

	// http://asm.sourceforge.net/syscall.html#p33
	// http://jakash3.wordpress.com/2010/10/14/linux-assembly/

	asm("MOVL $4, %eax");		// system call code for write
	asm("MOVL $1, %ebx");		// file descriptor = stdout (1)
	asm("MOVL %0, %%ecx" : : "m"(msg));	// pointer to buffer
	asm("MOVL $26, %edx");		// size of buffer
	asm("INT $0x80");		// software interrrupt to system call

	return 0;
}

Print a message to terminal screen

Print a message to terminal screen

Signed-off-by: Prashant Shah <80f978b5ac27fb318171799f0fb6a277863f2bf5@gmail.com>


#include <glib.h>

#ifndef BD_LIB
#define BD_LIB

#include "plugins.h"

gboolean bd_init (BDPluginSpec *force_plugins);
gboolean bd_reinit (BDPluginSpec *force_plugins, gboolean replace);
gchar** bd_get_available_plugin_names ();
gboolean bd_is_plugin_available (BDPlugin plugin);

#endif  /* BD_LIB */

#include <glib.h>

#ifndef BD_LIB
#define BD_LIB

#include "plugins.h"

gboolean bd_init (BDPluginSpec *force_plugins);
gboolean bd_reinit (BDPluginSpec *force_plugins, gboolean reload);
gchar** bd_get_available_plugin_names ();
gboolean bd_is_plugin_available (BDPlugin plugin);

#endif  /* BD_LIB */

Fix name of the paramenter for requesting plugin reload

'reload' better explains what happens than 'replace'.


#pragma once

namespace Rumia
{
    template<typename Ty, typename ContainerTy>
    class Iterator
    {
    public:
        using DataType = Ty;
        using ContainerType = ContainerTy;

    public:
        Iterator( ContainerType& container ) : m_container( container )
        {
        }

        virtual ~Iterator( ) { }

        virtual Ty& operator*( ) = 0;
        virtual Ty& operator*( ) const = 0;

    protected:
        ContainerType& m_container;

    };
}

#pragma once

namespace Rumia
{
    template<typename Ty, typename ContainerTy>
    class Iterator
    {
    public:
        using DataType = Ty;
        using ContainerType = ContainerTy;

    public:
        Iterator( ContainerType& container ) : m_container( container )
        {
        }

        virtual ~Iterator( ) { }

        virtual Ty& operator*( ) const = 0;

    protected:
        ContainerType& m_container;

    };
}

Delete non-const reference operator pure virtual function


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

int main( int argc, char *argv[] ){

	int *pointer;
    int i;
	pointer = (int*)malloc(sizeof(int)*1337);

	//Declare 5 arrays of 'char' variables
	char *space0, *space1, *space2, *space3, *space4;

	//Accomodate some (random) space for them
	space0 = (char*) malloc (sizeof(char) *333333);
    space1 = (char*) malloc (sizeof(char) *44444);
	space2 = (char*) malloc (sizeof(char) *3214);
	space3 = (char*) malloc (sizeof(char) *10000000);
	space4 = (char*) malloc (sizeof(char) *55630);

	//Do this 100 times
	for(i=0; i < 100; i++){

		//Attempt to resize the memory block pointed to by 'pointer' for i*1337 bytes
		pointer = (int*)realloc(pointer,(i*1337) );

		sleep(2); // not needed

	}

	return 0;
}

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

int main( int argc, char *argv[] ){

	int *pointer;
    int i;
	pointer = (int*)malloc(sizeof(int)*1337);

	//Declare 5 arrays of 'char' variables
	char *space0, *space1, *space2, *space3, *space4;

	clock_t begin = clock();
	//Accomodate some (random) space for them
	space0 = (char*) malloc (sizeof(char) *333333);
    space1 = (char*) malloc (sizeof(char) *44444);
	space2 = (char*) malloc (sizeof(char) *3214);
	space3 = (char*) malloc (sizeof(char) *10000000);
	space4 = (char*) malloc (sizeof(char) *55630);

	//Do this 100 times
	for(i=0; i < 100; i++){

		//Attempt to resize the memory block pointed to by 'pointer' for i*1337 bytes - big size
		pointer = (int*)realloc(pointer,(i*1337) );

		sleep(2); // not needed

	}

	clock_t end = clock();

	//return time in an internal scale called "clocks"
	double time_spent = (double)(end-begin) * 1000.0 / CLOCKS_PER_SEC;
	printf("%Time elapsed with the current algorithm is %f ", time_spent);

	return 0;
}

Test Program that accomodates space now returns the time spent


#include "leafnode.h"
#include "ln_log.h"

#include <signal.h>
#include <setjmp.h>

#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif

#include <unistd.h>

static jmp_buf to;
static RETSIGTYPE
timer(int sig)
{
    (void)sig;
    siglongjmp(to, 1);
}

/*
 * call getaline with timeout
 */
char *
timeout_getaline(FILE * f, unsigned int timeout)
{
    char *l;
    struct sigaction sa;

    if (sigsetjmp(to, 1)) {
	ln_log(LNLOG_SERR, LNLOG_CTOP, "timeout reading.");
	return NULL;
    }
    sa.sa_handler = timer;
    sa.sa_flags = SA_NOCLDSTOP | SA_RESTART;
    sigemptyset(&sa.sa_mask);
    (void)sigaction(SIGALRM, &sa, NULL);
    (void)alarm(timeout);
    l = getaline(f);
    (void)alarm(0U);
    return l;
}

char *
mgetaline(FILE * f)
{
    return timeout_getaline(f, timeout_client);
}

#include "leafnode.h"
#include "ln_log.h"

#include <signal.h>
#include <setjmp.h>

#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif

#include <unistd.h>

static sigjmp_buf to;
static RETSIGTYPE
timer(int sig)
{
    (void)sig;
    siglongjmp(to, 1);
}

/*
 * call getaline with timeout
 */
char *
timeout_getaline(FILE * f, unsigned int timeout)
{
    char *l;
    struct sigaction sa;

    if (sigsetjmp(to, 1)) {
	ln_log(LNLOG_SERR, LNLOG_CTOP, "timeout reading.");
	return NULL;
    }
    sa.sa_handler = timer;
    sa.sa_flags = SA_NOCLDSTOP | SA_RESTART;
    sigemptyset(&sa.sa_mask);
    (void)sigaction(SIGALRM, &sa, NULL);
    (void)alarm(timeout);
    l = getaline(f);
    (void)alarm(0U);
    return l;
}

char *
mgetaline(FILE * f)
{
    return timeout_getaline(f, timeout_client);
}

Fix type: jmp_buf -> sigjmp_buf.

Fix type: jmp_buf -> sigjmp_buf.


#ifndef COMM_H_
#define COMM_H_

#define COMM_BUFFER_LEN 3

typedef struct{
  uint8_t key;
  uint16_t val;
}
comm_t;

// Buffer messages to sent to the monitor
comm_t comm_buffer[COMM_BUFFER_LEN];
unsigned char comm_head;
unsigned char comm_tail;

/**
 * Push an element onto the end of the  buffer.
 */
void comm_push(comm_t d)
{
   // Add to the buffer
   comm_buffer[comm_head] = d;

   // Increment the index
   comm_head++;
   if (comm_head >= COMM_BUFFER_LEN) {
       comm_head = 0;
   }

}

/**
 * Shift an element off the beginning of the buffer.
 */
comm_t comm_shift()
{
    comm_t d = comm_buffer[comm_tail];
    // Increase the processed index
    comm_tail++;
    if (comm_tail >= COMM_BUFFER_LEN) {
        comm_tail = 0;
    }

    return d;
}

/**
 * Determine whether the buffer is empty.
 */
uint8_t comm_empty()
{
    if (comm_head == comm_tail) {
        return 1;
    }
    return 0;
}

#endif

#ifndef COMM_H_
#define COMM_H_

#define COMM_BUFFER_LEN 4

typedef struct{
  uint8_t key;
  uint16_t val;
}
comm_t;

// Buffer messages to sent to the monitor
comm_t comm_buffer[COMM_BUFFER_LEN];
unsigned char comm_head;
unsigned char comm_tail;

/**
 * Push an element onto the end of the  buffer.
 */
void comm_push(comm_t d)
{
   // Add to the buffer
   comm_buffer[comm_head] = d;

   // Increment the index
   comm_head++;
   if (comm_head >= COMM_BUFFER_LEN) {
       comm_head = 0;
   }

}

/**
 * Shift an element off the beginning of the buffer.
 */
comm_t comm_shift()
{
    comm_t d = comm_buffer[comm_tail];
    // Increase the processed index
    comm_tail++;
    if (comm_tail >= COMM_BUFFER_LEN) {
        comm_tail = 0;
    }

    return d;
}

/**
 * Determine whether the buffer is empty.
 */
uint8_t comm_empty()
{
    if (comm_head == comm_tail) {
        return 1;
    }
    return 0;
}

#endif

Make the buffer a little larger

Make the buffer a little larger


#ifndef _ZCCONSTANTS_H_
#define _ZCCONSTANTS_H_

#define ZC_NUM_JS_INPUTS 2
#define ZC_NUM_JS_OUTPUTS 2
#define INCREMENTAL_MERKLE_TREE_DEPTH 29
#define INCREMENTAL_MERKLE_TREE_DEPTH_TESTING 4

#define ZC_NOTEPLAINTEXT_LEADING 1
#define ZC_V_SIZE 8
#define ZC_RHO_SIZE 32
#define ZC_R_SIZE 32
#define ZC_MEMO_SIZE 512

#define ZC_NOTEPLAINTEXT_SIZE ZC_NOTEPLAINTEXT_LEADING + ZC_V_SIZE + ZC_RHO_SIZE + ZC_R_SIZE + ZC_MEMO_SIZE

#define ZKSNARK_PROOF_SIZE 584

#endif // _ZCCONSTANTS_H_

#ifndef _ZCCONSTANTS_H_
#define _ZCCONSTANTS_H_

#define ZC_NUM_JS_INPUTS 2
#define ZC_NUM_JS_OUTPUTS 2
#define INCREMENTAL_MERKLE_TREE_DEPTH 29
#define INCREMENTAL_MERKLE_TREE_DEPTH_TESTING 4

#define ZC_NOTEPLAINTEXT_LEADING 1
#define ZC_V_SIZE 8
#define ZC_RHO_SIZE 32
#define ZC_R_SIZE 32
#define ZC_MEMO_SIZE 512

#define ZC_NOTEPLAINTEXT_SIZE (ZC_NOTEPLAINTEXT_LEADING + ZC_V_SIZE + ZC_RHO_SIZE + ZC_R_SIZE + ZC_MEMO_SIZE)

#define ZKSNARK_PROOF_SIZE 584

#endif // _ZCCONSTANTS_H_

Add parenthesis around macro value definition


#ifndef COMPAT_H
#define COMPAT_H

#ifndef HAVE_PLEDGE
#include "pledge.h"
#endif

#ifndef timespecsub
#define	timespecsub(tsp, usp, vsp)					\
	do {								\
		(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec;		\
		(vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec;	\
		if ((vsp)->tv_nsec < 0) {				\
			(vsp)->tv_sec--;				\
			(vsp)->tv_nsec += 1000000000L;			\
		}							\
	} while (0)
#endif

#endif /* COMPAT_H */

#ifndef COMPAT_H
#define COMPAT_H

#ifndef HAVE_PLEDGE
#include "pledge.h"
#endif

/* Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available */
#ifndef CLOCK_MONOTONIC
#define CLOCK_MONOTONIC CLOCK_REALTIME
#endif

#ifndef timespecsub
#define	timespecsub(tsp, usp, vsp)					\
	do {								\
		(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec;		\
		(vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec;	\
		if ((vsp)->tv_nsec < 0) {				\
			(vsp)->tv_sec--;				\
			(vsp)->tv_nsec += 1000000000L;			\
		}							\
	} while (0)
#endif

#endif /* COMPAT_H */


#include <assert.h>

int main()
{
	int x = 285;
	int y = 23;
	assert(x / y == 12);

	return 0;
}

Add forgotten test for /

Add forgotten test for /


#ifndef __EXGL_H__
#define __EXGL_H__

#include <OpenGLES/ES2/gl.h>
#include <JavaScriptCore/JSBase.h>

#ifdef __cplusplus
extern "C" {
#endif

// Identifies an EXGL context. No EXGL context has the id 0, so that can be
// used as a 'null' value.
typedef unsigned int EXGLContextId;

// [JS thread] Create an EXGL context and return its id number. Saves the
// JavaScript interface object (has a WebGLRenderingContext-style API) at
// `global.__EXGLContexts[id]` in JavaScript.
EXGLContextId EXGLContextCreate(JSGlobalContextRef jsCtx);

// [Any thread] Release the resources for an EXGL context. The same id is never
// reused.
void EXGLContextDestroy(EXGLContextId exglCtxId);

// [GL thread] Perform one frame's worth of queued up GL work
void EXGLContextFlush(EXGLContextId exglCtxId);

// [GL thread] Set the default framebuffer (used when binding 0)
void EXGLContextSetDefaultFramebuffer(EXGLContextId exglCtxId, GLint framebuffer);

#ifdef __cplusplus
}
#endif

#endif

#ifndef __EXGL_H__
#define __EXGL_H__

#include <OpenGLES/ES2/gl.h>
#include <JavaScriptCore/JSBase.h>

#ifdef __cplusplus
extern "C" {
#endif

// Identifies an EXGL context. No EXGL context has the id 0, so that can be
// used as a 'null' value.
typedef unsigned int EXGLContextId;

// [JS thread] Create an EXGL context and return its id number. Saves the
// JavaScript interface object (has a WebGLRenderingContext-style API) at
// `global.__EXGLContexts[id]` in JavaScript.
EXGLContextId EXGLContextCreate(JSGlobalContextRef jsCtx);

// [Any thread] Release the resources for an EXGL context. The same id is never
// reused.
void EXGLContextDestroy(EXGLContextId exglCtxId);

// [GL thread] Perform one frame's worth of queued up GL work
void EXGLContextFlush(EXGLContextId exglCtxId);

// [GL thread] Set the default framebuffer (used when binding 0). Allows using
// platform-specific extensions on the default framebuffer, such as MSAA.
void EXGLContextSetDefaultFramebuffer(EXGLContextId exglCtxId, GLint framebuffer);

#ifdef __cplusplus
}
#endif

#endif

Clarify need for custom default framebuffer

fbshipit-source-id: 40e157b


#include <metric.h>
#include <gm_mmn.h>

#include <libmetrics.h>

mmodule core_metrics;

/*
** A helper function to determine the number of cpustates in /proc/stat (MKN)
*/

static int core_metrics_init ( apr_pool_t *p )
{
    int i;

    for (i = 0; core_metrics.metrics_info[i].name != NULL; i++) {
        /* Initialize the metadata storage for each of the metrics and then
         *  store one or more key/value pairs.  The define MGROUPS defines
         *  the key for the grouping attribute. */
        MMETRIC_INIT_METADATA(&(core_metrics.metrics_info[i]),p);
        MMETRIC_ADD_METADATA(&(core_metrics.metrics_info[i]),MGROUP,"core");
    }

    return 0;
}

static void core_metrics_cleanup ( void )
{
}

static g_val_t core_metrics_handler ( int metric_index )
{
    g_val_t val;

    /* The metric_index corresponds to the order in which
       the metrics appear in the metric_info array
    */
    switch (metric_index) {
    case 0:
        return gexec_func();
    case 1:
        return heartbeat_func();
    case 2:
        return location_func();
    }

    /* default case */
    val.int32 = 0;
    return val;
}

static Ganglia_25metric core_metrics_info[] =
{
    {0, "gexec",      300, GANGLIA_VALUE_STRING,       "",        "zero", "%s", UDP_HEADER_SIZE+32, "gexec available"},
    {0, "heartbeat",   20, GANGLIA_VALUE_UNSIGNED_INT, "",        "",     "%u", UDP_HEADER_SIZE+8,  "Last heartbeat"},
    {0, "location",  1200, GANGLIA_VALUE_STRING,       "(x,y,z)", "",     "%s", UDP_HEADER_SIZE+12, "Location of the machine"},
    {0, NULL}
};

mmodule core_metrics =
{
    STD_MMODULE_STUFF,
    core_metrics_init,
    core_metrics_cleanup,
    core_metrics_info,
    core_metrics_handler,
};

Move heartbeat, location and gexec metrics to a core module that will always be statically linked

git-svn-id: 27e0aca8c7a52a9ae65dfba2e16879604119af8c@913 93a4e39c-3214-0410-bb16-828d8e3bcd0f


// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently

#pragma once

#ifndef STRICT
#define STRICT
#endif

#include "targetver.h"

#define _CRT_SECURE_NO_WARNINGS
#define _ATL_APARTMENT_THREADED

#define _ATL_NO_AUTOMATIC_NAMESPACE

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS	// some CString constructors will be explicit

#define ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW

#include "resource.h"
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently

#pragma once

#ifndef STRICT
#define STRICT
#endif

#include "targetver.h"

#define _CRT_SECURE_NO_WARNINGS
#define _ATL_APARTMENT_THREADED

#define _ATL_NO_AUTOMATIC_NAMESPACE

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS	// some CString constructors will be explicit

#define ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW

#include "resource.h"
#include <atlbase.h>
#include <atlcom.h>
#include <atlstr.h>

Swap out header in precompiled header file


/*
 * cfree.c
 */

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

void
cfree(void *foo)
{
	free(foo);
}

Add __FBSDID()s to internal libgnumalloc()


/* libunwind - a platform-independent unwind library
   Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
	Contributed by David Mosberger-Tang <davidm@hpl.hp.com>

This file is part of libunwind.

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.  */

#include "tdep.h"

PROTECTED int
unw_is_fpreg (int regnum)
{
  return ((regnum >= UNW_X86_ST0 && regnum <= UNW_X86_ST7)
	  || (regnum >= UNW_X86_XMM0_lo && regnum <= UNW_X86_XMM7_hi));
}

(unw_is_fpreg): Declare as returning an "int" and fix typo.

(Logical change 1.158)


/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
    psimpl-c
    Copyright (c) 2013 Jamie Bullock <jamie@jamiebullock.com>

    Based on psimpl
    Copyright (c) 2010-2011 Elmar de Koning <edekoning@gmail.com>
*/

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

double *psimpl_simplify_douglas_peucker(
                                        uint8_t dimensions,
                                        double tolerance,
                                        double *original_points,
                                        double *simplified_points
                                        );

#ifdef __cplusplus
}
#endif

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
    psimpl-c
    Copyright (c) 2013 Jamie Bullock <jamie@jamiebullock.com>

    Based on psimpl
    Copyright (c) 2010-2011 Elmar de Koning <edekoning@gmail.com>
*/

#ifndef PSIMPL_C

#include <stdint.h>

typedef enum psimpl_LineDimension_
{
    psimpl_LineDimension_1D = 1,
    psimpl_LineDimension_2D,
    psimpl_LineDimension_3D
}
psimpl_LineDimension;

#ifdef __cplusplus
extern "C" {
#endif

double *psimpl_simplify_douglas_peucker(
                                        psimpl_LineDimension dimensions,
                                        uint64_t points,
                                        double tolerance,
                                        double *original_points,
                                        double *simplified_points
                                        );

#ifdef __cplusplus
}
#endif

#endif // #ifdef PSIMPL_C

Update API to only support 1, 2 or 3 dimensional lines


/* gmp3.c -- Test calc of Dilogarithm. */

/* Last change: 27-Mar-2012.  Ken Roberts  */

/* Calc Li_2(u+iv)
 * then Li_2(u+iv)
 * again.  Expect consistent results.
 * Looking for possible bug re caching
 * of info within cpx_polylog logic.
 */

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <db_185.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <gmp.h>
#include "anant/src/mp-complex.h"
#include "anant/anant.h"

ulong gprec;
ulong aprec;

int main (
  int    argc,
  char * argv[])
{

  double u, v;
  cpx_t s, z, pl1b, pl1e;
  int  res;

  gprec = 1000;
  mpf_set_default_prec (gprec);
  aprec = 50;

  cpx_init (s);
  cpx_init (z);

  cpx_set_ui (s, 2, 0);

  u = 0.000005;
  v = 1.377128;

  cpx_set_d (z, u, v);

  printf ("\n");
  gmp_printf ("s = %10Ff + i %10Ff\n",
              s[0].re, s[0].im);
  gmp_printf ("z = %10Ff + i %10Ff\n",
              z[0].re, z[0].im);

  cpx_init (pl1b);
  cpx_init (pl1e);

  res = cpx_polylog (pl1b, s, z, aprec);
  gmp_printf ("Rtn %d, Li_2(z) = %10Ff + i %10Ff\n",
              res, pl1b[0].re, pl1b[0].im);

  res = cpx_polylog (pl1e, s, z, aprec);
  gmp_printf ("Rtn %d, Li_2(z) = %10Ff + i %10Ff\n",
              res, pl1e[0].re, pl1e[0].im);

  printf ("\n");
  exit (0);
};

Add a polylog bug report

Add a polylog bug report


#pragma once

/* Customer Structure */
typedef struct customer {
	char name[25];			// Customer's name
	long int accnum;		// Customer's Account Number
	long int balance;		// Customer's Balance
	long long int ccn;		// Customer's CCN
	short int pin;			// Customer's PIN
} customer;

/* Current Logged In Customer */
long int currentUserLoggedIn = 0L;

bool Login_Menu();
int CCN_VALIDATE(long long CCN);
int CCNLength(long long cardNumber);
bool CCNCheckLuhn(long long cardNumber, int digits);
int getDigit(long long cardNumber, int location);
void Show_Stats(long currentUserLoggedIn);
bool CCN_OwnerExists(long long CCN);
bool PIN_Validate(long long CCN, short int PIN);
void LoginUser(long long CCN, short PIN);
string GetAccNum(long long CCN);
string CCN_GetOwner(long long CCN);
void ATMMenu(long accnum);
void cash_withdraw(long accnum);
void pay_utilitybill(long accnum);
void credit_transfer(long accnum);
void acc_update(long accnum);
void add_funds(long accnum);

customer customers[5];

char char* welcome_message = "********************************\
						*-->Welcome to Bahria Bank!<---*\
						********************************\n";

#pragma once

/* Customer Structure */
typedef struct customer {
	char name[25];			// Customer's name
	long int accnum;		// Customer's Account Number
	long int balance;		// Customer's Balance
	long long int ccn;		// Customer's CCN
	short int pin;			// Customer's PIN
} customer;

/* Current Logged In Customer */
long int currentUserLoggedIn = 0L;

bool Login_Menu();
int CCN_VALIDATE(long long CCN);
int CCNLength(long long cardNumber);
bool CCNCheckLuhn(long long cardNumber, int digits);
int getDigit(long long cardNumber, int location);
void Show_Stats(long currentUserLoggedIn);
bool CCN_OwnerExists(long long CCN);
bool PIN_Validate(long long CCN, short int PIN);
void LoginUser(long long CCN, short PIN);
string GetAccNum(long long CCN);
string CCN_GetOwner(long long CCN);
void ATMMenu(long accnum);
void cash_withdraw(long accnum);
void pay_utilitybill(long accnum);
void credit_transfer(long accnum);
void acc_update(long accnum);
void add_funds(long accnum);

customer customers[5];

const char* welcome_message = "********************************\
						*-->Welcome to Bahria Bank!<---*\
						********************************\n";

Fix declaration of welcome message!

Fix declaration of welcome message!


#include <stdio.h>

int main(int argc, char** argv) {
    if (argc < 2) {
        return 1; // No word given - error
    }

    char* word = argv[1];
    int index = 0;
    short seen[256] = {0};
    char c;

    while (c = word[index]) {
        printf("%c\n", c);
        if (seen[c]) {
            printf("Not unique - saw two of '%c'.\n", c);
            return 0;
        }
        seen[c] = 1;
        index += 1;
    }

    printf("Word has no duplicate chars.\n");
    return 0;
}

Determine if a string has all unique chars


#ifndef IMAGEPROCESSINGSTRATEGY_H
#define IMAGEPROCESSINGSTRATEGY_H

#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/ocl/ocl.hpp"
#include "constants.h"
#include "qdebug.h"

using namespace std;
using namespace cv;

class ImageProcessingStrategy
{
public:
    ImageProcessingStrategy();
    Mat applyBlur(Mat src);
    Mat applyLaplacian(Mat src);
    Mat applyEdge(Mat src);
    Mat applySubs(Mat raw_src, Mat ref_src);
    Mat applyContourns(Mat src);
    int processBlur();
    int processLaplacian();
    int processEdge();
    int processSubs();
    int processContourns();
};

#endif // IMAGEPROCESSINGSTRATEGY_H

#ifndef IMAGEPROCESSINGSTRATEGY_H
#define IMAGEPROCESSINGSTRATEGY_H

#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/gpu/gpu.hpp"
#include "constants.h"
#include "qdebug.h"

using namespace std;
using namespace cv;

class ImageProcessingStrategy
{
public:
    ImageProcessingStrategy();
    Mat applyBlur(Mat src);
    Mat applyLaplacian(Mat src);
    Mat applyEdge(Mat src);
    Mat applySubs(Mat raw_src, Mat ref_src);
    Mat applyContourns(Mat src);
    int processBlur();
    int processLaplacian();
    int processEdge();
    int processSubs();
    int processContourns();
};

#endif // IMAGEPROCESSINGSTRATEGY_H

Fix cuda incomplete type issue

Fix cuda incomplete type issue


Add BOTAN_DLL to Timer class declaration


#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "../src/rootdb.h"

int main(void)
{
  MDB_env *env;
  MDB_dbi dbi;
  int status;

  status = rootdb_open(&env, &dbi, "./testingdb");
  assert(status == 0);

  char key_char[] = "hello";
  char value_char[] = "world";
  MDB_val key;
  MDB_val value;

  key.mv_size = sizeof(key_char);
  key.mv_data = key_char;
  value.mv_size = sizeof(value_char);
  value.mv_data = value_char;

  printf("key: %p %.*s, data: %p %.*s\n",
	 key.mv_data,  (int) key.mv_size,  (char *) key.mv_data,
	 value.mv_data, (int) value.mv_size, (char *) value.mv_data);

  status = rootdb_put(&env, dbi, &key, &value);
  assert(status == 0);

  MDB_val rvalue;

  status = rootdb_get(&env, dbi, &key, &rvalue);
  assert(status == 0);

  printf("key: %p %.*s, data: %p %.*s\n",
	 key.mv_data,  (int) key.mv_size,  (char *) key.mv_data,
	 rvalue.mv_data, (int) rvalue.mv_size, (char *) rvalue.mv_data);

  rootdb_close(&env, dbi);

  return 0;

}

#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include "../src/rootdb.h"

int main(void)
{
  MDB_env *env;
  MDB_dbi dbi;
  int status;

  status = rootdb_open(&env, &dbi, "./testingdb");
  assert(status == 0);

  char key_char[] = "hello";
  char value_char[] = "world";
  MDB_val key;
  MDB_val value;

  key.mv_size = sizeof(key_char);
  key.mv_data = key_char;
  value.mv_size = sizeof(value_char);
  value.mv_data = value_char;

  status = rootdb_put(&env, dbi, &key, &value);
  assert(status == 0);

  MDB_val rvalue;

  status = rootdb_get(&env, dbi, &key, &rvalue);
  assert(status == 0);
  assert(strcmp(rvalue.mv_data, value.mv_data) == 0);

  rootdb_close(&env, dbi);

  return 0;

}

Add assertion for value in get/put test

Add assertion for value in get/put test


/*
 * Insert Copyright Here.
 */

#ifdef LBS
#define	MASTERNODE	"206.163.153.25"
#else
#define	MASTERNODE	"boss.emulab.net"
#endif

#define TBSERVER_PORT	7777
#define MYBUFSIZE	1024

/*
 * Insert Copyright Here.
 */

#ifdef LBS
#define	MASTERNODE	"192.168.1.25"
#else
#define	MASTERNODE	"boss.emulab.net"
#endif

#define TBSERVER_PORT	7777
#define MYBUFSIZE	1024

Change the IP of my home machine for testing.


/**
 * This is used to setup the UART device on an AVR unit.
 */

#pragma once

#include <avr/io.h>

#ifndef BAUD
#  define BAUD 9600
#  warning BAUD rate not set.  Setting BAUD rate to 9600.
#endif // BAUD

#define BAUDRATE ((F_CPU)/(BAUD*16UL)-1)

static inline void uart_enable(void) {
  UBRR0H = BAUDRATE >> 8;
  UBRR0L = BAUDRATE;

  // Set RX/TN enabled
  UCSR0B |= _BV(TXEN0) | _BV(RXEN0);

  // Set asynchronous USART
  // Set frame format: 8-bit data, 2-stop bit
  UCSR0C |= _BV(USBS0) | _BV(UCSZ01) | _BV(UCSZ00);
}

static inline void uart_transmit(unsigned char data) {
  while (!(UCSR0A & _BV(UDRE0)));
  UDR0 = data;
}

static inline unsigned char uart_receive(void) {
  while (!(UCSR0A & _BV(RXC0)));
  return UDR0;
}

/**
 * This is used to setup the UART device on an AVR unit.
 */

#pragma once

#ifdef __cplusplus
extern "C" {
#endif

#include <avr/io.h>

#ifndef BAUD
#  define BAUD 9600
#  warning BAUD rate not set.  Setting BAUD rate to 9600.
#endif // BAUD

#define BAUDRATE ((F_CPU)/(BAUD*16UL)-1)

/**
 * @brief Enables the UART device for 8-bit data at
 * the specified {@see BAUDRATE}.
 */
static inline void uart_enable(void) {
  UBRR0H = BAUDRATE >> 8;
  UBRR0L = BAUDRATE;

  // Set RX/TN enabled
  UCSR0B |= _BV(TXEN0) | _BV(RXEN0);

  // Set asynchronous USART
  // Set frame format: 8-bit data, 2-stop bit
  UCSR0C |= _BV(USBS0) | _BV(UCSZ01) | _BV(UCSZ00);
}

/**
 * @brief Transmits a character through the UART device.
 * @param data The data to be sent.
 */
static inline void uart_transmit(unsigned char data) {
  while (!(UCSR0A & _BV(UDRE0)));
  UDR0 = data;
}

/**
 * @brief Receives a character from the UART device.
 * @return Received character from the UART.
 */
static inline unsigned char uart_receive(void) {
  while (!(UCSR0A & _BV(RXC0)));
  return UDR0;
}

#ifdef __cplusplus
} // extern "C"
#endif

Add some comments, clean up the code, and add extern "C".


//
//  PopView.h
//  LYPOPVIEW
//
//  CREATED BY LUO YU ON 19/12/2016.
//  COPYRIGHT © 2016 LUO YU. ALL RIGHTS RESERVED.
//

#ifndef PopView_h
#define PopView_h

#import <LYPopView/LYPopView.h>
#import <LYPopView/LYPopMessage.h>
#import <LYPopView/LYPopTable.h>
#import <LYPopView/LYPopActionView.h>

#endif /* PopView_h */

//
//  PopView.h
//  LYPOPVIEW
//
//  CREATED BY LUO YU ON 19/12/2016.
//  COPYRIGHT © 2016 LUO YU. ALL RIGHTS RESERVED.
//

#ifndef PopView_h
#define PopView_h

#import <LYPopView/LYPopView.h>
#import <LYPopView/LYPopMessage.h>
#import <LYPopView/LYPopTable.h>
#import <LYPopView/LYPopDate.h>
#import <LYPopView/LYPopActionView.h>

#endif /* PopView_h */

Add : date picker pop view importer

Add : date picker pop view importer


#ifndef __LACO_H
#define __LACO_H

struct lua_State;

/* State of laco REPL */
struct LacoState {
  struct lua_State* L;
  const char* version;

  int argc;
  const char** argv;

  int status;
};

/**
 * Initilazation of laco's state
 *
 * param          pointer to LacoState
 * param          argument count (argc)
 * param          arguments      (argv)
 */
void laco_initLacoState(struct LacoState*, int, const char**);

/**
 * Destroys the internal variable, but doesn't try to free the LacoState
 * pointer itself.
 *
 * param          pointer to LacoState
 *
 * return 1 if pointer isn't NULL
 */
int laco_destroyLacoState(struct LacoState*);

#endif /* __LACO_H */

#ifndef __LACO_H
#define __LACO_H

struct lua_State;

/* State of laco REPL */
struct LacoState {
  struct lua_State* L;
  const char* version;

  int argc;
  const char** argv;

  int status;
};

typedef struct LacoState LacoState;

/**
 * Initilazation of laco's state
 *
 * param          pointer to LacoState
 * param          argument count (argc)
 * param          arguments      (argv)
 */
void laco_initLacoState(struct LacoState*, int, const char**);

/**
 * Destroys the internal variable, but doesn't try to free the LacoState
 * pointer itself.
 *
 * param          pointer to LacoState
 *
 * return 1 if pointer isn't NULL
 */
int laco_destroyLacoState(struct LacoState*);

#endif /* __LACO_H */

Add typedef of LacoState in header

Add typedef of LacoState in header

This is so the code base isn't littered with `typedef struct LacoState
LacoState`.


Save one more byte by casting loop counter u to a char


#include <stdio.h>

int main() {

  // imprime o cabecalho do nosso jogo
  printf("******************************************\n");
  printf("* Bem vindo ao nosso jogo de adivinhação *\n");
  printf("******************************************\n");

  int numerosecreto = 42;

  int chute;

  printf("Qual é o seu chute? ");
  scanf("%d", &chute);
  printf("Seu chute foi %d\n", chute);

  if(chute == numerosecreto) {
    printf("Parabéns! Você acertou!\n");
    printf("Jogue de novo, você é um bom jogador!\n");
  }
  else {
    if(chute > numerosecreto) {
      printf("Seu chute foi maior que o número secreto\n");
    }

    if(chute < numerosecreto) {
      printf("Seu chute foi menor que o número secreto\n");
    }

    printf("Você errou!\n");
    printf("Mas não desanime, tente de novo!\n");
  }

}

#include <stdio.h>

int main() {

  // imprime o cabecalho do nosso jogo
  printf("******************************************\n");
  printf("* Bem vindo ao nosso jogo de adivinhação *\n");
  printf("******************************************\n");

  int numerosecreto = 42;

  int chute;

  printf("Qual é o seu chute? ");
  scanf("%d", &chute);
  printf("Seu chute foi %d\n", chute);

  int acertou = chute == numerosecreto;

  if(acertou) {
    printf("Parabéns! Você acertou!\n");
    printf("Jogue de novo, você é um bom jogador!\n");
  } else {

    int maior = chute > numerosecreto;

    if(maior) {
      printf("Seu chute foi maior que o número secreto\n");
    } else {
      printf("Seu chute foi menor que o número secreto\n");
    }

    printf("Você errou!\n");
    printf("Mas não desanime, tente de novo!\n");
  }

}

Update files, Alura, Introdução a C, Aula 2.3


/*
* Integer Rounding Functions
* (C) 1999-2007 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/

#ifndef BOTAN_ROUNDING_H_
#define BOTAN_ROUNDING_H_

#include <botan/types.h>

namespace Botan {

/**
* Round up
* @param n a non-negative integer
* @param align_to the alignment boundary
* @return n rounded up to a multiple of align_to
*/
inline size_t round_up(size_t n, size_t align_to)
   {
   BOTAN_ARG_CHECK(align_to != 0, "align_to must not be 0");

   if(n % align_to)
      n += align_to - (n % align_to);
   return n;
   }

/**
* Round down
* @param n an integer
* @param align_to the alignment boundary
* @return n rounded down to a multiple of align_to
*/
template<typename T>
inline constexpr T round_down(T n, T align_to)
   {
   return (align_to == 0) ? n : (n - (n % align_to));
   }

/**
* Clamp
*/
inline size_t clamp(size_t n, size_t lower_bound, size_t upper_bound)
   {
   if(n < lower_bound)
      return lower_bound;
   if(n > upper_bound)
      return upper_bound;
   return n;
   }

}

#endif

/*
* Integer Rounding Functions
* (C) 1999-2007 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/

#ifndef BOTAN_ROUNDING_H_
#define BOTAN_ROUNDING_H_

#include <botan/types.h>

namespace Botan {

/**
* Round up
* @param n a non-negative integer
* @param align_to the alignment boundary
* @return n rounded up to a multiple of align_to
*/
inline size_t round_up(size_t n, size_t align_to)
   {
   BOTAN_ARG_CHECK(align_to != 0, "align_to must not be 0");

   if(n % align_to)
      n += align_to - (n % align_to);
   return n;
   }

/**
* Round down
* @param n an integer
* @param align_to the alignment boundary
* @return n rounded down to a multiple of align_to
*/
template<typename T>
inline constexpr T round_down(T n, T align_to)
   {
   return (align_to == 0) ? n : (n - (n % align_to));
   }

}

#endif

Remove clamp, which was unused

Remove clamp, which was unused

(And replaced by the std:: version in C++17 if we did need it)


// All-in-one import for Braintree 3D Secure

#import <Braintree/BTThreeDSecure.h>

Add a new line to end of file

Add a new line to end of file


//
//  RSCCControlCellView.h
//  CocoaControls
//
//  Created by R0CKSTAR on 14-5-5.
//  Copyright (c) 2014年 P.D.Q. All rights reserved.
//

#import <Cocoa/Cocoa.h>

extern int const RSCCControlCellViewImageButtonTagBase;
extern int const RSCCControlCellViewCocoaPodsButtonTagBase;
extern int const RSCCControlCellViewCloneButtonTagBase;

@class RSCCControlCellViewBackgroundView;

@interface RSCCControlCellView : NSTableCellView

@property (nonatomic, weak) IBOutlet RSCCControlCellViewBackgroundView *backgroundView;

@property (nonatomic, weak) IBOutlet NSButton *imageButton;

@property (nonatomic, weak) IBOutlet NSTextField *titleField;

@property (nonatomic, weak) IBOutlet NSTextField *dateField;

@property (nonatomic, weak) IBOutlet NSTextField *licenseField;

@property (nonatomic, weak) IBOutlet NSButton *cocoaPodsButton;

@property (nonatomic, weak) IBOutlet NSButton *cloneButton;

@property (nonatomic, weak) IBOutlet NSImageView *star0;

@property (nonatomic, weak) IBOutlet NSImageView *star1;

@property (nonatomic, weak) IBOutlet NSImageView *star2;

@property (nonatomic, weak) IBOutlet NSImageView *star3;

@property (nonatomic, weak) IBOutlet NSImageView *star4;

@property (nonatomic, strong) NSArray *stars;

@end

//
//  RSCCControlCellView.h
//  CocoaControls
//
//  Created by R0CKSTAR on 14-5-5.
//  Copyright (c) 2014年 P.D.Q. All rights reserved.
//

#import <Cocoa/Cocoa.h>

extern int const RSCCControlCellViewImageButtonTagBase;
extern int const RSCCControlCellViewCocoaPodsButtonTagBase;
extern int const RSCCControlCellViewCloneButtonTagBase;

@class RSCCControlCellViewBackgroundView;

@interface RSCCControlCellView : NSTableCellView

@property (assign) IBOutlet RSCCControlCellViewBackgroundView *backgroundView;

@property (assign) IBOutlet NSButton *imageButton;

@property (assign) IBOutlet NSTextField *titleField;

@property (assign) IBOutlet NSTextField *dateField;

@property (assign) IBOutlet NSTextField *licenseField;

@property (assign) IBOutlet NSButton *cocoaPodsButton;

@property (assign) IBOutlet NSButton *cloneButton;

@property (assign) IBOutlet NSImageView *star0;

@property (assign) IBOutlet NSImageView *star1;

@property (assign) IBOutlet NSImageView *star2;

@property (assign) IBOutlet NSImageView *star3;

@property (assign) IBOutlet NSImageView *star4;

@property (nonatomic, strong) NSArray *stars;

@end

Change nonatomic, weak to assign for all IBOutlets


// @(#)root/thread:$Id$
// Author: Philippe Canal   09/30/2011

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TThreadSlots
#define ROOT_TThreadSlots

namespace ROOT {

   enum EThreadSlotReservation {
      // Describe the system wide slot pre-allocation in the TThread
      // 'special data' storage array ; meant to be used as thread local
      // storage.  (See TThread::Tsd)
      //
      // Slot 0 through 19 can be used for user application
      // Slot 20 and above are reserved for the global system
      kMaxUserThreadSlot   = 20,

      // Slot reserved by ROOT's packages.
      kPadThreadSlot       = 20,
      kClassThreadSlot     = 21,
      kDirectoryThreadSlot = 22,
      kFileThreadSlot      = 23,

      kMaxThreadSlot       = 24  // Size of the array of thread local slots in TThread
   };
}

#ifndef __CINT__
R__EXTERN void **(*gThreadTsd)(void*,Int_t);
#endif

#endif // ROOT_TThreadSlots

// @(#)root/base:$Id$
// Author: Philippe Canal   09/30/2011

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TThreadSlots
#define ROOT_TThreadSlots

namespace ROOT {

   enum EThreadSlotReservation {
      // Describe the system wide slot pre-allocation in the TThread
      // 'special data' storage array ; meant to be used as thread local
      // storage.  (See TThread::Tsd)
      //
      // Slot 0 through 19 can be used for user application
      // Slot 20 and above are reserved for the global system
      kMaxUserThreadSlot   = 20,

      // Slot reserved by ROOT's packages.
      kPadThreadSlot       = 20,
      kClassThreadSlot     = 21,
      kDirectoryThreadSlot = 22,
      kFileThreadSlot      = 23,

      kMaxThreadSlot       = 24  // Size of the array of thread local slots in TThread
   };
}

#ifndef __CINT__
R__EXTERN void **(*gThreadTsd)(void*,Int_t);
#endif

#endif // ROOT_TThreadSlots

Fix module loc.
Add missing final newline.

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@41534 27541ba8-7e3a-0410-8455-c3a389f83636


#ifndef lilthumb
#define lilthumb

#include <ctime>
#include <ostream>

namespace lilthumb{

std::string timeString()
{
  time_t rawtime;
  struct tm * timeinfo;
  char buffer[80];

  time (&rawtime);
  timeinfo = localtime(&rawtime);

  strftime(buffer,80,"%d-%m-%Y %I:%M:%S",timeinfo);
  std::string str(buffer);

  return str;
}

void stone( std::ostream& stream, std::string message )
{
  stream << timeString() << " | " << message << std::endl;
}

}

#endif

#ifndef lilthumb
#define lilthumb

#include <ctime>
#include <ostream>

namespace lilthumb{

std::string timeString()
{
  time_t rawtime;
  struct tm * timeinfo;
  char buffer[80];

  time (&rawtime);
  timeinfo = localtime(&rawtime);

  strftime(buffer,80,"%d-%m-%Y %I:%M:%S",timeinfo);
  std::string str(buffer);

  return str;
}

void stone( std::ostream& stream, double* c_array, int n_values = 0 )
{
  stream << timeString() << " | ";
  if( n_values == 0 )
  {
    stream << c_array << std::endl;
  }
  else
  {
    for( int i = 0; i < n_values - 1; i++ )
    {
      stream << c_array[i] << "/";
    }
    stream << c_array[n_values - 1] << std::endl;
  }
}

void stone( std::ostream& stream, std::string message )
{
  stream << timeString() << " | " << message << std::endl;
}

}

#endif

Add a n-tuple vector logging function

Add a n-tuple vector logging function


/*
  High_Temp.h

  2014 Copyright (c) Seeed Technology Inc.  All right reserved.

  Loovee
  2013-4-14

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  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
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
#ifndef __HIGH_TEMP_H__
#define __HIGH_TEMP_H__

class HighTemp{

public:

    HighTemp(int _pinTmp, int _pinThmc);

    float getRoomTmp();                      //
    float getThmc();

    void begin();

private
    float tempRoom;                         // room temperature
    float tempThmc;                         // thermocouple temperature
    int pinRoomTmp;                         // pin of temperature sensor
    int pinThmc;                            // pin of thermocouple

public:

    int getAnalog(int pin);
    float K_VtoT(float mV);                 // K type thermocouple, mv->oC
    float getThmcVol();                     // get voltage of thmc in mV
};

#endif

/*
  High_Temp.h

  2014 Copyright (c) Seeed Technology Inc.  All right reserved.

  Loovee
  2013-4-14

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  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
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
#ifndef __HIGH_TEMP_H__
#define __HIGH_TEMP_H__

class HighTemp{

public:

    HighTemp(int _pinTmp, int _pinThmc);

    float getRoomTmp();                      //
    float getThmc();

    void begin();

private:
    float tempRoom;                         // room temperature
    float tempThmc;                         // thermocouple temperature
    int pinRoomTmp;                         // pin of temperature sensor
    int pinThmc;                            // pin of thermocouple

public:

    virtual int getAnalog(int pin);
    float K_VtoT(float mV);                 // K type thermocouple, mv->oC
    float getThmcVol();                     // get voltage of thmc in mV
};

#endif

Add virtual decl to getAnalog to enable overloading


/*
 * Portions Copyright (c) 1987, 1993, 1994
 * The Regents of the University of California.  All rights reserved.
 *
 * Portions Copyright (c) 2003-2014, PostgreSQL Global Development Group
 *
 * src/include/pg_getopt.h
 */
#ifndef PG_GETOPT_H
#define PG_GETOPT_H

/* POSIX says getopt() is provided by unistd.h */
#include <unistd.h>

/* rely on the system's getopt.h if present */
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif

/*
 * If we have <getopt.h>, assume it declares these variables, else do that
 * ourselves.  (We used to just declare them unconditionally, but Cygwin
 * doesn't like that.)
 */
#ifndef HAVE_GETOPT_H

extern char *optarg;
extern int	optind;
extern int	opterr;
extern int	optopt;

#ifdef HAVE_INT_OPTRESET
extern int	optreset;
#endif

#endif   /* HAVE_GETOPT_H */

#ifndef HAVE_GETOPT
extern int	getopt(int nargc, char *const * nargv, const char *ostr);
#endif

#endif   /* PG_GETOPT_H */

/*
 * Portions Copyright (c) 1987, 1993, 1994
 * The Regents of the University of California.  All rights reserved.
 *
 * Portions Copyright (c) 2003-2014, PostgreSQL Global Development Group
 *
 * src/include/pg_getopt.h
 */
#ifndef PG_GETOPT_H
#define PG_GETOPT_H

/* POSIX says getopt() is provided by unistd.h */
#include <unistd.h>

/* rely on the system's getopt.h if present */
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif

/*
 * If we have <getopt.h>, assume it declares these variables, else do that
 * ourselves.  (We used to just declare them unconditionally, but Cygwin
 * doesn't like that.)
 */
#ifndef HAVE_GETOPT_H

extern char *optarg;
extern int	optind;
extern int	opterr;
extern int	optopt;

#endif   /* HAVE_GETOPT_H */

/*
 * Some platforms have optreset but not <getopt.h>.  Cygwin, however,
 * doesn't like this either.
 */
#if defined(HAVE_INT_OPTRESET) && !defined(__CYGWIN__)
extern int	optreset;
#endif

#ifndef HAVE_GETOPT
extern int	getopt(int nargc, char *const * nargv, const char *ostr);
#endif

#endif   /* PG_GETOPT_H */

Allow for platforms that have optreset but not <getopt.h>.

Reportedly, some versions of mingw are like that, and it seems plausible
in general that older platforms might be that way.  However, we'd
determined experimentally that just doing "extern int" conflicts with
the way Cygwin declares these variables, so explicitly exclude Cygwin.

Michael Paquier, tweaked by me to hopefully not break Cygwin


//
// Licensed under the terms in License.txt
//
// Copyright 2010 Allen Ding. All rights reserved.
//

#import "KiwiConfiguration.h"

@protocol KWMatching<NSObject>

#pragma mark - Initializing

- (id)initWithSubject:(id)anObject;

#pragma mark - Getting Matcher Strings

+ (NSArray *)matcherStrings;

#pragma mark - Getting Matcher Compatability

+ (BOOL)canMatchSubject:(id)anObject;

#pragma mark - Matching

@optional

@property (nonatomic, readonly) BOOL isNilMatcher;

- (BOOL)shouldBeEvaluatedAtEndOfExample;
- (BOOL)willEvaluateMultipleTimes;
- (void)setWillEvaluateMultipleTimes:(BOOL)shouldEvaluateMultipleTimes;

@required

- (BOOL)evaluate;

#pragma mark - Getting Failure Messages

- (NSString *)failureMessageForShould;
- (NSString *)failureMessageForShouldNot;

@end

//
// Licensed under the terms in License.txt
//
// Copyright 2010 Allen Ding. All rights reserved.
//

#import "KiwiConfiguration.h"

@protocol KWMatching<NSObject>

#pragma mark - Initializing

- (id)initWithSubject:(id)anObject;

#pragma mark - Getting Matcher Strings

+ (NSArray *)matcherStrings;

#pragma mark - Getting Matcher Compatability

+ (BOOL)canMatchSubject:(id)anObject;

#pragma mark - Matching

@optional

- (BOOL)isNilMatcher;
- (BOOL)shouldBeEvaluatedAtEndOfExample;
- (BOOL)willEvaluateMultipleTimes;
- (void)setWillEvaluateMultipleTimes:(BOOL)shouldEvaluateMultipleTimes;

@required

- (BOOL)evaluate;

#pragma mark - Getting Failure Messages

- (NSString *)failureMessageForShould;
- (NSString *)failureMessageForShouldNot;

@end

Use method declaration instead of property


//
//  FFMSongUpdater.h
//  FringeFM
//
//  Created by John Sheets on 6/10/12.
//  Copyright (c) 2012 John Sheets. All rights reserved.
//
// MIT License
//
// 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.

#import <Foundation/Foundation.h>

@class FFMSong;

@interface FFMSongUpdater : NSObject

@property (nonatomic, strong) NSImage *icon;
@property (nonatomic) NSTimeInterval updateFrequency;

- (FFMSong *)fetchCurrentSong;
- (BOOL)isServiceAvailable;
- (BOOL)isServicePlaying;

@end

//
//  FFMSongUpdater.h
//  FringeFM
//
//  Created by John Sheets on 6/10/12.
//  Copyright (c) 2012 John Sheets. All rights reserved.
//
// MIT License
//
// 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.

#import <Foundation/Foundation.h>

@class FFMSong;

@interface FFMSongUpdater : NSObject

@property (nonatomic, strong) NSImage *icon;
@property (nonatomic) NSUInteger updateFrequency;

- (FFMSong *)fetchCurrentSong;
- (BOOL)isServiceAvailable;
- (BOOL)isServicePlaying;

@end

Switch song updater updateFrequency from NSTimeInterval (length of time) to NSUInteger (number of counter seconds to skip).


#ifndef _ASM_IPCBUF_H_
#define _ASM_IPCBUF_H

/*
 * The ipc64_perm structure for MN10300 architecture.
 * Note extra padding because this structure is passed back and forth
 * between kernel and user space.
 *
 * Pad space is left for:
 * - 32-bit mode_t and seq
 * - 2 miscellaneous 32-bit values
 */

struct ipc64_perm
{
	__kernel_key_t		key;
	__kernel_uid32_t	uid;
	__kernel_gid32_t	gid;
	__kernel_uid32_t	cuid;
	__kernel_gid32_t	cgid;
	__kernel_mode_t		mode;
	unsigned short		__pad1;
	unsigned short		seq;
	unsigned short		__pad2;
	unsigned long		__unused1;
	unsigned long		__unused2;
};

#endif /* _ASM_IPCBUF_H */

#ifndef _ASM_IPCBUF_H
#define _ASM_IPCBUF_H

/*
 * The ipc64_perm structure for MN10300 architecture.
 * Note extra padding because this structure is passed back and forth
 * between kernel and user space.
 *
 * Pad space is left for:
 * - 32-bit mode_t and seq
 * - 2 miscellaneous 32-bit values
 */

struct ipc64_perm
{
	__kernel_key_t		key;
	__kernel_uid32_t	uid;
	__kernel_gid32_t	gid;
	__kernel_uid32_t	cuid;
	__kernel_gid32_t	cgid;
	__kernel_mode_t		mode;
	unsigned short		__pad1;
	unsigned short		seq;
	unsigned short		__pad2;
	unsigned long		__unused1;
	unsigned long		__unused2;
};

#endif /* _ASM_IPCBUF_H */

Fix typo in header guard

MN10300: Fix typo in header guard

Fix a typo in the header guard of asm/ipc.h.

Signed-off-by: Vegard Nossum <c9abf7248a519119ccb31f4fd3c3a4e0b6ebd20b@gmail.com>
Signed-off-by: David Howells <ebac1d06c1688626821bb0e574a037a7a5354e49@redhat.com>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>


int set_empty(void)
{
	return 0;
}

int set_size(int set)
{
	int size = 0;
	while (set)
	{
		size += set & 1;
		set >>= 1;
	}
	return size;
}

int set_add(int set, int element)
{
	return set | (1 << element);
}

int set_empty(void)
{
	return 0;
}

int set_size(int set)
{
	/* Bit-Twiddling Hacks */
	/* TODO: shall export to bits module to provide more robust solutions
	 * based on hardware capabilities (eg. popcount instruction) */
	set = set - ((set >> 1) & ~(unsigned int)0/3);
	set = (set & ~(unsigned int)0/15*3) + ((set >> 2) & ~(unsigned int)0/15*3);
	set = (set + (set >> 4)) & ~(unsigned int)0/255*15;
	return (set * (~(unsigned int)0/255)) >> (sizeof(int) - 1) * 8;
}

int set_add(int set, int element)
{
	return set | (1 << element);
}

Optimize counting size of larger sets

[SET] REFACTOR: Optimize counting size of larger sets


#pragma once

#define	SPINLOCK_DEBUG		1

// Mutual exclusion lock.
struct spinlock {
  u32 locked;       // Is the lock held?

#if SPINLOCK_DEBUG
  // For debugging:
  char *name;        // Name of lock.
  struct cpu *cpu;   // The cpu holding the lock.
  uptr pcs[10];      // The call stack (an array of program counters)
                     // that locked the lock.
#endif
};

static inline const char *lockname(struct spinlock *s)
{
#if SPINLOCK_DEBUG
  return s->name ?: "null";
#else
  return "unknown";
#endif
}

#pragma once

#define	SPINLOCK_DEBUG		1

// Mutual exclusion lock.
struct spinlock {
  u32 locked;       // Is the lock held?

#if SPINLOCK_DEBUG
  // For debugging:
  char *name;        // Name of lock.
  struct cpu *cpu;   // The cpu holding the lock.
  uptr pcs[10];      // The call stack (an array of program counters)
                     // that locked the lock.
#endif
};

#if SPINLOCK_DEBUG
#define lockname(s) ((s)->name ?: "null")
#else
#define lockname(s) ("unknown")
#endif

Make lockname(s) a macro instead of a inline.


#include "backend.h"
#include "frontend.h"
#include <ncurses.h>

int main() {
  initscr();
  cbreak();
  noecho();
  keypad(stdscr, TRUE); // make keys work
  curs_set(0); // hide cursor
  timeout(100);

  int xmax;
  int ymax;
  getmaxyx(stdscr, ymax, xmax);
  enum Direction dir = RIGHT;

  Board* board = create_board(create_snake(), NULL, xmax, ymax);
  int i;
  for (i = 0; i < 6; i++) {
    add_new_food(board);
  }

  while(true) {
    erase();
    display_points(board->snake, ACS_BLOCK);
    display_points(board->foods, ACS_DIAMOND);
    dir = get_next_move(dir);
    enum Status status = move_snake(board, dir);
    if (status == FAILURE) break;
  }
  endwin();

  return 0;
}

#include "backend.h"
#include "frontend.h"
#include <ncurses.h>

int main() {
  initscr();
  cbreak();
  noecho();
  keypad(stdscr, TRUE); // make keys work
  curs_set(0); // hide cursor
  timeout(100);

  int xmax;
  int ymax;
  getmaxyx(stdscr, ymax, xmax);
  enum Direction dir = RIGHT;

  Board* board = create_board(create_snake(), NULL, xmax, ymax);
  int i;
  for (i = 0; i < 6; i++) {
    add_new_food(board);
  }

  while(true) {
    clear();
    display_points(board->snake, ACS_BLOCK);
    display_points(board->foods, ACS_DIAMOND);
    refresh();
    dir = get_next_move(dir);
    enum Status status = move_snake(board, dir);
    if (status == FAILURE) break;
  }
  endwin();

  return 0;
}

Call `clear` and `refresh` to update screen


// Copyright (c) 2016 Brian Barto
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the MIT License. See LICENSE for more details.

#ifndef MAIN_H
#define MAIN_H 1

#define VERSION          "0.1.0"
#define DEFAULT_KEY_NAME "default"
#define DEFAULT_KEY_PATH ".config/mirrorcrypt/"
#define GRID_SIZE        24
#define SUPPORTED_CHARS  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+{}[]|\\:; \n\t\"'<>,.?/~"

#endif

// Copyright (c) 2016 Brian Barto
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the MIT License. See LICENSE for more details.

#ifndef MAIN_H
#define MAIN_H 1

#define VERSION          "0.1.0"
#define DEFAULT_KEY_NAME "default"
#define DEFAULT_KEY_PATH ".config/mrrcrypt/"
#define GRID_SIZE        24
#define SUPPORTED_CHARS  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+{}[]|\\:; \n\t\"'<>,.?/~"

#endif

Change config dir name to mrrcrypt

Change config dir name to mrrcrypt

	modified:   src/main.h


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

#include "sw/device/silicon_creator/lib/drivers/lifecycle.h"
#include "sw/device/silicon_creator/lib/drivers/otp.h"
#include "sw/device/silicon_creator/lib/drivers/rstmgr.h"

// TODO(#12905): This file includes fake definitions for the functions that are
// used by the silicon_creator bootstrap implementation but missing in the
// english breakfast top level due to hardware limitations.

#if !OT_IS_ENGLISH_BREAKFAST
#error "This file should be compiled only for the english breakfast top level"
#endif

void lifecycle_hw_rev_get(lifecycle_hw_rev_t *hw_rev) {
  *hw_rev = (lifecycle_hw_rev_t){
      .chip_gen = 0,
      .chip_rev = 0,
  };
}

uint32_t otp_read32(uint32_t address) { return kHardenedBoolTrue; }

void rstmgr_reset(void) {
  while (true) {
  }
}

[sw/test_rom] Add fake functions for hardware missing in english breakfast

Signed-off-by: Alphan Ulusoy <23b245cc5a07aacf75a9db847b24c67dee1707bf@google.com>


/**
 * @file 	  util.c
 * @author 	  Bryce Davis
 * @date      19 November 2015
 * @brief     Header file for internal libbad declarations
 * @copyright Copyright (c) 2015, Bryce Davis. Released under the MIT License.
 *            See LICENSE.txt for details.
 */

#include <stdio.h>

#include "libbad_base.h"

/**
 * @brief      A nicer function to print an integer from a DATA
 *
 * @param      d     A pointer to a DATA
 */
#define data_print_int(d) data_fprint_int(stdin, (d))

/**
 * @brief      Print an integer from a DATA
 *
 * @param      out   a pointer to the output file
 * @param      data  a pointer to a DATA
 */
void data_fprint_int(FILE* out, DATA data)
{
	fprintf(out, "%lld", data.data_int);
}

Implement function to print an integer from a DATA


/*
 * setup MY_BPFTIMEVAL as the timeval structure that bpf packets
 * will be assoicated with packets from libpcap
 */
#ifdef __OpenBSD__
# define MY_BPFTIMEVAL bpf_timeval
#endif
#ifndef MY_BPFTIMEVAL
# define MY_BPFTIMEVAL timeval
#endif
typedef struct MY_BPFTIMEVAL my_bpftimeval;

/*
 * Structure to contain IP addresses
 */
typedef struct {
        int                     af;
        union {
                struct in_addr          a4;
                struct in6_addr         a6;
        } u;
} iaddr;

/*
 * plugins can call the logerr() function in the main dnscap
 * process.
 */
typedef int logerr_t(const char *fmt, ...);

/*
 * Prototype for the plugin "output" function
 */
typedef void output_t(const char *descr,
        iaddr from,
        iaddr to,
        uint8_t proto,
        int isfrag,
        unsigned sport,
        unsigned dport,
        my_bpftimeval ts,
        const u_char *pkt_copy,
        unsigned olen,
        const u_char *dnspkt,
        unsigned dnslen);

#define DIR_INITIATE	0x0001
#define DIR_RESPONSE	0x0002

#include <netinet/in.h>

/*
 * setup MY_BPFTIMEVAL as the timeval structure that bpf packets
 * will be assoicated with packets from libpcap
 */
#ifndef MY_BPFTIMEVAL
# define MY_BPFTIMEVAL timeval
#endif
typedef struct MY_BPFTIMEVAL my_bpftimeval;

/*
 * Structure to contain IP addresses
 */
typedef struct {
        int                     af;
        union {
                struct in_addr          a4;
                struct in6_addr         a6;
        } u;
} iaddr;

/*
 * plugins can call the logerr() function in the main dnscap
 * process.
 */
typedef int logerr_t(const char *fmt, ...);

/*
 * Prototype for the plugin "output" function
 */
typedef void output_t(const char *descr,
        iaddr from,
        iaddr to,
        uint8_t proto,
        int isfrag,
        unsigned sport,
        unsigned dport,
        my_bpftimeval ts,
        const u_char *pkt_copy,
        unsigned olen,
        const u_char *dnspkt,
        unsigned dnslen);

#define DIR_INITIATE	0x0001
#define DIR_RESPONSE	0x0002

Fix compilation on FreeBSD and OpenBSD

Fix compilation on FreeBSD and OpenBSD


/*
   FreeRDP: A Remote Desktop Protocol client.
   GDI Shape Functions

   Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>

   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 __GDI_SHAPE_H
#define __GDI_SHAPE_H

#include "gdi.h"

int Ellipse(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
int Polygon(HDC hdc, POINT *lpPoints, int nCount);
int FillRect(HDC hdc, HRECT rect, HBRUSH hbr);

#endif /* __GDI_SHAPE_H */

/*
   FreeRDP: A Remote Desktop Protocol client.
   GDI Shape Functions

   Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>

   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 __GDI_SHAPE_H
#define __GDI_SHAPE_H

#include "gdi.h"

void ShapeInit();
int Ellipse(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
int Polygon(HDC hdc, POINT *lpPoints, int nCount);
int FillRect(HDC hdc, HRECT rect, HBRUSH hbr);

#endif /* __GDI_SHAPE_H */

Fix missing declaration for ShapeInit()

Fix missing declaration for ShapeInit()


#include "support.h"

#include "vio/csync_vio_file_stat.h"

START_TEST (check_csync_vio_file_stat_new)
{
  csync_vio_file_stat_t *stat = NULL;

  stat = csync_vio_file_stat_new();
  fail_if(stat == NULL, NULL);

  csync_vio_file_stat_destroy(stat);
}
END_TEST

static Suite *csync_vio_suite(void) {
  Suite *s = suite_create("csync_vio_file_stat");

  create_case(s, "check_csync_vio_file_stat_new", check_csync_vio_file_stat_new);

  return s;
}

int main(void) {
  int nf;

  Suite *s = csync_vio_suite();

  SRunner *sr;
  sr = srunner_create(s);
#if 0
  srunner_set_fork_status(sr, CK_NOFORK);
#endif
  srunner_run_all(sr, CK_VERBOSE);
  nf = srunner_ntests_failed(sr);
  srunner_free(sr);

  return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}

#include "support.h"

#include "vio/csync_vio_file_stat.h"

START_TEST (check_csync_vio_file_stat_new)
{
  csync_vio_file_stat_t *tstat = NULL;

  tstat = csync_vio_file_stat_new();
  fail_if(tstat == NULL, NULL);

  csync_vio_file_stat_destroy(tstat);
}
END_TEST

static Suite *csync_vio_suite(void) {
  Suite *s = suite_create("csync_vio_file_stat");

  create_case(s, "check_csync_vio_file_stat_new", check_csync_vio_file_stat_new);

  return s;
}

int main(void) {
  int nf;

  Suite *s = csync_vio_suite();

  SRunner *sr;
  sr = srunner_create(s);
#if 0
  srunner_set_fork_status(sr, CK_NOFORK);
#endif
  srunner_run_all(sr, CK_VERBOSE);
  nf = srunner_ntests_failed(sr);
  srunner_free(sr);

  return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}

Fix build warning for shadowed variable.


#include <caml/mlvalues.h>
#include <caml/memory.h>
#include <caml/custom.h>
#include <caml/callback.h>
#include <caml/alloc.h>

#include <stdio.h>

#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h>
#endif

CAMLprim value stub_get_SOMAXCONN(){
  fprintf(stderr, "SOMAXCONN = %d\n", SOMAXCONN);
  return (Val_int (SOMAXCONN));
}

#include <caml/mlvalues.h>
#include <caml/memory.h>
#include <caml/custom.h>
#include <caml/callback.h>
#include <caml/alloc.h>

#include <stdio.h>

#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h>
#endif

CAMLprim value stub_get_SOMAXCONN(value unit){
  fprintf(stderr, "SOMAXCONN = %d\n", SOMAXCONN);
  return (Val_int (SOMAXCONN));
}

Add `value` parameter to SOMAXCONN binding

Problem spotted by yallop in
https://github.com/moby/vpnkit/commit/8d718125a66fbe746ba17ad3e85b7924ac0ed9a4#commitcomment-21930309

Signed-off-by: David Scott <63c9eb0ea83039690fefa11afe17873ba8278a56@docker.com>


//
//  AIBHTMLWebView.h
//  AIBHTMLWebView
//
//  Created by Thomas Parslow on 05/04/2015.
//  Copyright (c) 2015 Thomas Parslow. MIT License.
//

#import "RCTView.h"

@class RCTEventDispatcher;

@interface AIBHTMLWebView : RCTView

@property (nonatomic, strong) NSString *HTML;

- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;

@end

//
//  AIBHTMLWebView.h
//  AIBHTMLWebView
//
//  Created by Thomas Parslow on 05/04/2015.
//  Copyright (c) 2015 Thomas Parslow. MIT License.
//

#import "RCTView.h"

@class RCTEventDispatcher;

@interface AIBHTMLWebView : RCTView

@property (nonatomic, strong) NSString *HTML;

- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;

- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;

@end

Remove designated initializer compiler warnings


#pragma once

#include "Control.h"
#include "../../3RVX/Logger.h"

class Label : public Control {
public:
    Label() {

    }

    Label(int id, HWND parent) :
    Control(id, parent) {

    }

    virtual bool Text(std::wstring text) {
        bool result = Control::Text(text);
        if (result == false) {
            return false;
        }

        /* Determine the width of the text */
        HDC dc = GetDC(_hWnd);
        SIZE sz = { 0 };
        GetTextExtentPoint32(dc, &text[0], text.size(), &sz);

        /* Update the window size based on the text size */
        RECT r = Control::ScreenDimensions();
        POINT pt = { r.left, r.top };
        ScreenToClient(_parent, &pt);
        MoveWindow(_hWnd, pt.x, pt.y, sz.cx, sz.cy, TRUE);
        return true;
    }
};

#pragma once

#include "Control.h"
#include "../../3RVX/Logger.h"

class Label : public Control {
public:
    Label() {

    }

    Label(int id, HWND parent) :
    Control(id, parent) {

    }

    virtual bool Text(std::wstring text) {
        bool result = Control::Text(text);
        if (result == false) {
            return false;
        }

        Width(TextDimensions().cx);

//        /* Determine the width of the text */
//        HDC dc = GetDC(_hWnd);
//        SIZE sz = { 0 };
//        GetTextExtentPoint32(dc, &text[0], text.size(), &sz);

//        /* Update the window size based on the text size */
//        RECT r = Control::ScreenDimensions();
//        POINT pt = { r.left, r.top };
//        ScreenToClient(_parent, &pt);
//        MoveWindow(_hWnd, pt.x, pt.y, sz.cx, sz.cy, TRUE);
        return true;
    }
};

Test the new width functionality

Test the new width functionality


/*
 * ccn/keystore.h
 *
 * KEYSTORE interface
 *
 * This is a veneer so that the ccn code can avoid exposure to the
 * underlying keystore implementation types
 */
#ifndef CCN_KEYSTORE_DEFINED
#define CCN_KEYSTORE_DEFINED

#include <stddef.h>

struct ccn_keystore;

struct ccn_keystore *ccn_keystore_create();
void ccn_keystore_destroy(struct ccn_keystore **p);
int ccn_keystore_init(struct ccn_keystore *p, char *name, char *password);
const void *ccn_keystore_private_key(struct ccn_keystore *p);
const void *ccn_keystore_public_key(struct ccn_keystore *p);
const void *ccn_keystore_certificate(struct ccn_keystore *p);

#endif

/*
 * ccn/keystore.h
 *
 * KEYSTORE interface
 *
 * This is a veneer so that the ccn code can avoid exposure to the
 * underlying keystore implementation types
 */
#ifndef CCN_KEYSTORE_DEFINED
#define CCN_KEYSTORE_DEFINED

#include <stddef.h>

struct ccn_keystore;

struct ccn_keystore *ccn_keystore_create(void);
void ccn_keystore_destroy(struct ccn_keystore **p);
int ccn_keystore_init(struct ccn_keystore *p, char *name, char *password);
const void *ccn_keystore_private_key(struct ccn_keystore *p);
const void *ccn_keystore_public_key(struct ccn_keystore *p);
const void *ccn_keystore_certificate(struct ccn_keystore *p);

#endif

Fix missing void in parameterless call prototype


#ifndef SOTA_CLIENT_TOOLS_OSTREE_HASH_H_
#define SOTA_CLIENT_TOOLS_OSTREE_HASH_H_

#include <cstdint>
#include <cstring>  // memcmp, memcpy

#include <iostream>
#include <string>

class OSTreeHash {
 public:
  /**
   * Parse an OSTree hash from a string. This will normally be a root commit.
   * @throws OSTreeCommitParseError on invalid input
   * TODO test cases
   */
  static OSTreeHash Parse(const std::string& hash);

  explicit OSTreeHash(const uint8_t[32]);

  std::string string() const;

  bool operator<(const OSTreeHash& other) const;
  friend std::ostream& operator<<(std::ostream& os, const OSTreeHash& hash);

 private:
  uint8_t hash_[32];
};

class OSTreeCommitParseError : std::exception {
 public:
  OSTreeCommitParseError(const std::string bad_hash) : bad_hash_(bad_hash) {}

  virtual const char* what() const noexcept { return "Could not parse OSTree commit"; }

  std::string bad_hash() const { return bad_hash_; }

 private:
  std::string bad_hash_;
};

#endif  // SOTA_CLIENT_TOOLS_OSTREE_HASH_H_

#ifndef SOTA_CLIENT_TOOLS_OSTREE_HASH_H_
#define SOTA_CLIENT_TOOLS_OSTREE_HASH_H_

#include <cstdint>
#include <cstring>  // memcmp, memcpy

#include <iostream>
#include <string>

class OSTreeHash {
 public:
  /**
   * Parse an OSTree hash from a string. This will normally be a root commit.
   * @throws OSTreeCommitParseError on invalid input
   */
  static OSTreeHash Parse(const std::string& hash);

  explicit OSTreeHash(const uint8_t[32]);

  std::string string() const;

  bool operator<(const OSTreeHash& other) const;
  friend std::ostream& operator<<(std::ostream& os, const OSTreeHash& hash);

 private:
  uint8_t hash_[32];
};

class OSTreeCommitParseError : std::exception {
 public:
  OSTreeCommitParseError(const std::string bad_hash) : bad_hash_(bad_hash) {}

  virtual const char* what() const noexcept { return "Could not parse OSTree commit"; }

  std::string bad_hash() const { return bad_hash_; }

 private:
  std::string bad_hash_;
};

#endif  // SOTA_CLIENT_TOOLS_OSTREE_HASH_H_

Remove TODO test comment about OSTreeHash::Parse

PRO-4592


/*
 * Copyright © 2009 CNRS
 * Copyright © 2009-2010 INRIA
 * Copyright © 2009-2010 Université Bordeaux 1
 * See COPYING in top-level directory.
 */

#include <private/config.h>
#include <hwloc.h>

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>

int main(void)
{
  hwloc_topology_t topology;
  hwloc_bitmap_t cpuset;
  hwloc_obj_t obj;

  hwloc_topology_init(&topology);
  hwloc_topology_load(topology);
  hwloc_topology_check(topology);
  cpuset = hwloc_bitmap_alloc();
  hwloc_bitmap_set(cpuset, 0);
  obj = hwloc_topology_insert_misc_object_by_cpuset(topology, cpuset, "test");
  hwloc_topology_insert_misc_object_by_parent(topology, obj, "test2");
  hwloc_topology_check(topology);
  hwloc_topology_destroy(topology);

  return 0;
}

/*
 * Copyright © 2009 CNRS
 * Copyright © 2009-2010 INRIA
 * Copyright © 2009-2010 Université Bordeaux 1
 * See COPYING in top-level directory.
 */

#include <private/config.h>
#include <hwloc.h>

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>

int main(void)
{
  hwloc_topology_t topology;
  hwloc_bitmap_t cpuset;
  hwloc_obj_t obj;

  hwloc_topology_init(&topology);
  hwloc_topology_load(topology);
  hwloc_topology_check(topology);
  cpuset = hwloc_bitmap_alloc();
  hwloc_bitmap_set(cpuset, 0);
  obj = hwloc_topology_insert_misc_object_by_cpuset(topology, cpuset, "test");
  hwloc_bitmap_free(cpuset);
  hwloc_topology_insert_misc_object_by_parent(topology, obj, "test2");
  hwloc_topology_check(topology);
  hwloc_topology_destroy(topology);

  return 0;
}

Fix a memory leak in tests

Fix a memory leak in tests

This commit was SVN r2903.


#include <sys/types.h>
#include <linux/unistd.h>
#include <gettid.h>
#include <errno.h>

/* Patch from Adam Conrad / Ubuntu: Don't use _syscall macro */

#ifdef __NR_gettid
pid_t gettid (void)
{
	return syscall(__NR_gettid);
}
#else

#warn "gettid not available -- substituting with pthread_self()"

#include <pthread.h>
pid_t gettid (void)
{
	return (pid_t)pthread_self();
}
#endif

#include <sys/types.h>
#include <linux/unistd.h>
#include <gettid.h>
#include <unistd.h>
#include <errno.h>

/* Patch from Adam Conrad / Ubuntu: Don't use _syscall macro */

#ifdef __NR_gettid
pid_t gettid (void)
{
	return syscall(__NR_gettid);
}
#else

#warn "gettid not available -- substituting with pthread_self()"

#include <pthread.h>
pid_t gettid (void)
{
	return (pid_t)pthread_self();
}
#endif

Add include so we get a prototype for syscall()


/*ckwg +5
 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
 * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
 * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
 */

#ifndef VISTK_PYTHON_HELPERS_PYTHON_CONVERT_ANY_H
#define VISTK_PYTHON_HELPERS_PYTHON_CONVERT_ANY_H

#include <boost/any.hpp>

#include <Python.h>

/**
 * \file python_convert_any.h
 *
 * \brief Helpers for working with boost::any in Python.
 */

namespace boost
{

namespace python
{

namespace converter
{

struct rvalue_from_python_stage1_data;

}

}

}

struct boost_any_to_object
{
  boost_any_to_object();
  ~boost_any_to_object();

  static void* convertible(PyObject* obj);
  static PyObject* convert(boost::any const& any);
  static void construct(PyObject* obj, boost::python::converter::rvalue_from_python_stage1_data* data);
};

#endif // VISTK_PYTHON_PIPELINE_PYTHON_CONVERT_ANY_H

/*ckwg +5
 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
 * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
 * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
 */

#ifndef VISTK_PYTHON_HELPERS_PYTHON_CONVERT_ANY_H
#define VISTK_PYTHON_HELPERS_PYTHON_CONVERT_ANY_H

#include <boost/any.hpp>

#include <Python.h>

/**
 * \file python_convert_any.h
 *
 * \brief Helpers for working with boost::any in Python.
 */

namespace boost
{

namespace python
{

namespace converter
{

struct rvalue_from_python_stage1_data;

}

}

}

class boost_any_to_object
{
  public:
    boost_any_to_object();
    ~boost_any_to_object();

    static void* convertible(PyObject* obj);
    static PyObject* convert(boost::any const& any);
    static void construct(PyObject* obj, boost::python::converter::rvalue_from_python_stage1_data* data);
};

#endif // VISTK_PYTHON_PIPELINE_PYTHON_CONVERT_ANY_H

Use a class instead of a struct

Use a class instead of a struct


/* BLACK color, which I presume was defined in graphics.h */
#define BLACK 0

/* BLACK color, which I presume was defined in the original graphics.h */
#define BLACK 0

/*
  All my original cpp files create constant ints named true and
  false. This worked with the Borland C++ compiler, but not gcc.
  I'll redefine them with a preprocessor macro to be a non-reserved
  name, but first I need to include all the system libraries because
  they may refer to the actual true/false variables.
*/
#include <alloc.h>
#include <assert.h>
#include <conio.h>
#include <ctype.h>
#include <dos.h>
#include <fstream.h>
#include <stdlib.h>
#include <time.h>

/* Now redefine true/false with non-reserved names */
#define true  local_true
#define false local_false

Handle reserved true/false variable names