int main()
{
  int m,n,**a,j,i;
  printf("Enter the number of rows in the matrix\n");
  scanf("%d",&m);
  printf("Enter the number of columns in the matrix\n");
  scanf("%d",&n);
  a=(int **)malloc(m*sizeof(int *));
  for(i=0;i<m;i++)
    a[i]=(int *)(malloc(n*sizeof(int)));
  printf("Enter the elements in the matrix\n");
  for(i=0;i<m;i++)
    for(j=0;j<n;j++)
      scanf("%d",&a[i][j]);
    printf("The matrix is\n");
  for(i=0;i<m;i++)
  {
      for(j=0;j<n;j++)
        printf("%d ",a[i][j]);
    printf("\n");
  }
  if(checkNull(a,m,n))
    printf("The matrix is null\n");
  else
    printf("The matrix is not null\n");
  
  return 0;
}
Ejemplo n.º 2
0
Array& Array::addRedisType(RedisType::Ptr value)
{
	checkNull();

	_elements.value().push_back(value);

	return *this;
}
Ejemplo n.º 3
0
jint Java_sun_misc_Unsafe_getIntVolatile(Env* env, Object* unsafe, Object* obj, jlong offset) {
    if (!checkNull(env, obj)) return 0;
    jint* address = (jint*) getFieldAddress(obj, offset);
    return rvmAtomicLoadInt(address);
}
Ejemplo n.º 4
0
jint Java_sun_misc_Unsafe_getInt(Env* env, Object* unsafe, Object* obj, jlong offset) {
    if (!checkNull(env, obj)) return 0;
    jint* address = (jint*) getFieldAddress(obj, offset);
    return *address;
}
Ejemplo n.º 5
0
jboolean Java_sun_misc_Unsafe_compareAndSwapObject(Env* env, Object* unsafe, Object* obj, jlong offset, Object* expectedValue, Object* newValue) {
    if (!checkNull(env, obj)) return FALSE;
    void** address = (void**) getFieldAddress(obj, offset);
    return rvmAtomicCompareAndSwapPtr(address, expectedValue, newValue);
}
Ejemplo n.º 6
0
jboolean Java_sun_misc_Unsafe_compareAndSwapInt(Env* env, Object* unsafe, Object* obj, jlong offset, jint expectedValue, jint newValue) {
    if (!checkNull(env, obj)) return FALSE;
    jint* address = (jint*) getFieldAddress(obj, offset);
    return rvmAtomicCompareAndSwapInt(address, expectedValue, newValue);
}
Ejemplo n.º 7
0
jlong Java_sun_misc_Unsafe_objectFieldOffset0(Env* env, Object* unsafe, Object* fieldObject) {
    if (!checkNull(env, fieldObject)) return 0;
    InstanceField* field = (InstanceField*) getFieldFromFieldObject(env, fieldObject);
    if (!field) return 0;
    return field->offset;
}
Ejemplo n.º 8
0
void Java_sun_misc_Unsafe_putOrderedObject(Env* env, Object* unsafe, Object* obj, jlong offset, Object* newValue) {
    if (!checkNull(env, obj)) return;
    Object** address = (Object**) getFieldAddress(obj, offset);
    rvmAtomicSynchronize();
    *address = newValue;
}
Ejemplo n.º 9
0
void Java_sun_misc_Unsafe_putObjectVolatile(Env* env, Object* unsafe, Object* obj, jlong offset, Object* newValue) {
    if (!checkNull(env, obj)) return;
    Object** address = (Object**) getFieldAddress(obj, offset);
    rvmAtomicStorePtr((void**) address, newValue);
}
Ejemplo n.º 10
0
void Java_sun_misc_Unsafe_putLongVolatile(Env* env, Object* unsafe, Object* obj, jlong offset, jlong newValue) {
    if (!checkNull(env, obj)) return;
    jlong* address = (jlong*) getFieldAddress(obj, offset);
    rvmAtomicStoreLong(address, newValue);
}
Ejemplo n.º 11
0
void Java_sun_misc_Unsafe_putLong(Env* env, Object* unsafe, Object* obj, jlong offset, jlong newValue) {
    if (!checkNull(env, obj)) return;
    jlong* address = (jlong*) getFieldAddress(obj, offset);
    *address = newValue;
}
Ejemplo n.º 12
0
Object* Java_sun_misc_Unsafe_getObjectVolatile(Env* env, Object* unsafe, Object* obj, jlong offset) {
    if (!checkNull(env, obj)) return NULL;
    Object** address = (Object**) getFieldAddress(obj, offset);
    return (Object*) rvmAtomicLoadPtr((void**) address);
}
Ejemplo n.º 13
0
Object* Java_sun_misc_Unsafe_getObject(Env* env, Object* unsafe, Object* obj, jlong offset) {
    if (!checkNull(env, obj)) return NULL;
    Object** address = (Object**) getFieldAddress(obj, offset);
    return *address;
}